[Ocfs2-tools-devel] [PATCH] mkfs.ocfs2: release memory before mkfs.ocfs2 exit
piaojun
piaojun at huawei.com
Sun Jan 27 17:23:08 PST 2019
Hi Jia
It seems that fs needs also to be released in format_backup_super():
finish_normal_format
format_backup_super
exit(1)
Thanks,
Jun
On 2019/1/25 15:42, Jia Guo wrote:
> Release memory before mkfs.ocfs2 exit.
>
> Signed-off-by: Jia Guo <guojia12 at huawei.com>
> ---
> mkfs.ocfs2/mkfs.c | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/mkfs.ocfs2/mkfs.c b/mkfs.ocfs2/mkfs.c
> index 932b905..4a0f741 100644
> --- a/mkfs.ocfs2/mkfs.c
> +++ b/mkfs.ocfs2/mkfs.c
> @@ -439,6 +439,7 @@ static void format_quota_files(State *s, ocfs2_filesys *fs)
> return;
> error:
> clear_both_ends(s);
> + ocfs2_close(fs);
> exit(1);
> }
>
> @@ -461,6 +462,7 @@ static void grow_extent_allocator(State *s, ocfs2_filesys *fs)
>
> error:
> clear_both_ends(s);
> + ocfs2_close(fs);
> exit(1);
> }
>
> @@ -3117,6 +3119,7 @@ static void create_lost_found_dir(State *s, ocfs2_filesys *fs)
>
> bail:
> clear_both_ends(s);
> + ocfs2_close(fs);
> exit(1);
> }
>
> @@ -3161,6 +3164,7 @@ static void format_journals(State *s, ocfs2_filesys *fs)
>
> error:
> clear_both_ends(s);
> + ocfs2_close(fs);
> exit(1);
> }
>
> @@ -3172,6 +3176,7 @@ static void format_slotmap(State *s, ocfs2_filesys *fs)
> if (ret) {
> com_err(s->progname, ret, "while formatting the slot map");
> clear_both_ends(s);
> + ocfs2_close(fs);
> exit(1);
> }
> }
>
>
> _______________________________________________
> Ocfs2-tools-devel mailing list
> Ocfs2-tools-devel at oss.oracle.com
> https://oss.oracle.com/mailman/listinfo/ocfs2-tools-devel
>
More information about the Ocfs2-tools-devel
mailing list