Use pre-existing early exit label in function to handle proper
error code return and local memory allocation cleanup.
Coverity ID: 23: Resource Leak
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
2007-03-21 Theodore Tso <tytso@mit.edu>
- * inode.c (ext2fs_write_inode_full): Fix memory leak on error
- return (when the inode table is missing).
+ * imager.c (ext2fs_image_inode_write), inode.c
+ (ext2fs_write_inode_full): Fix memory leak on error return
+ (when the inode table is missing).
2006-11-30 Theodore Tso <tytso@mit.edu>
for (group = 0; group < fs->group_desc_count; group++) {
blk = fs->group_desc[(unsigned)group].bg_inode_table;
- if (!blk)
- return EXT2_ET_MISSING_INODE_TABLE;
+ if (!blk) {
+ retval = EXT2_ET_MISSING_INODE_TABLE;
+ goto errout;
+ }
left = fs->inode_blocks_per_group;
while (left) {
c = BUF_BLOCKS;