[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Mon, 29 Nov 2010 17:55:09 +0900
From: Namhyung Kim <namhyung@...il.com>
To: Theodore Tso <tytso@....edu>
Cc: linux-ext4@...r.kernel.org
Subject: [PATCH 07/15] libext2fs: fix error path in ext2fs_update_bb_inode()
If ext2fs_get_mem() on rec.block_buf fails we should not call
ext2fs_free_mem() on it.
Signed-off-by: Namhyung Kim <namhyung@...il.com>
---
lib/ext2fs/bb_inode.c | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/lib/ext2fs/bb_inode.c b/lib/ext2fs/bb_inode.c
index 0b79b16..9576be2 100644
--- a/lib/ext2fs/bb_inode.c
+++ b/lib/ext2fs/bb_inode.c
@@ -74,8 +74,10 @@ errcode_t ext2fs_update_bb_inode(ext2_filsys fs, ext2_badblocks_list bb_list)
return retval;
memset(rec.ind_blocks, 0, rec.max_ind_blocks * sizeof(blk_t));
retval = ext2fs_get_mem(fs->blocksize, &rec.block_buf);
- if (retval)
- goto cleanup;
+ if (retval) {
+ ext2fs_free_mem(&rec.ind_blocks);
+ return retval;
+ }
memset(rec.block_buf, 0, fs->blocksize);
rec.err = 0;
--
1.7.0.4
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists