From 9d45b6ef7e6b87323309670165b90a0f1ac2f3a3 Mon Sep 17 00:00:00 2001 From: Brian Behlendorf Date: Wed, 28 Mar 2007 11:57:20 -0400 Subject: [PATCH] [COVERITY] Fix (error case only) memory leak in e2fsck pass #1 Coverity ID: 37: Resource Leak Coverity ID: 38: Resource Leak Signed-off-by: Brian Behlendorf --- e2fsck/ChangeLog | 4 ++-- e2fsck/pass1.c | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/e2fsck/ChangeLog b/e2fsck/ChangeLog index e3a1dff..20cea4d 100644 --- a/e2fsck/ChangeLog +++ b/e2fsck/ChangeLog @@ -1,7 +1,7 @@ 2007-03-28 Theodore Tso - * pass1.c (check_ext_attr), unix.c (parse_extended_opts): Fix - memory leak + * pass1.c (e2fsck_pass1, check_ext_attr), + unix.c (parse_extended_opts): Fix memory leak 2007-03-21 Theodore Tso diff --git a/e2fsck/pass1.c b/e2fsck/pass1.c index 6dcddc9..095f244 100644 --- a/e2fsck/pass1.c +++ b/e2fsck/pass1.c @@ -481,6 +481,7 @@ void e2fsck_pass1(e2fsck_t ctx) if (pctx.errcode) { fix_problem(ctx, PR_1_ALLOCATE_DBCOUNT, &pctx); ctx->flags |= E2F_FLAG_ABORT; + ext2fs_free_mem(&inode); return; } @@ -508,6 +509,8 @@ void e2fsck_pass1(e2fsck_t ctx) if (pctx.errcode) { fix_problem(ctx, PR_1_ISCAN_ERROR, &pctx); ctx->flags |= E2F_FLAG_ABORT; + ext2fs_free_mem(&block_buf); + ext2fs_free_mem(&inode); return; } ext2fs_inode_scan_flags(scan, EXT2_SF_SKIP_MISSING_ITABLE, 0); -- 1.8.3.1