Skip to content

Commit

Permalink
ext4: add missing kfree() on error return path in add_new_gdb()
Browse files Browse the repository at this point in the history
We added some more error handling in b409714 "ext4: add error
checking to calls to ext4_handle_dirty_metadata()".  But we need to
call kfree() as well to avoid a memory leak.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
  • Loading branch information
Dan Carpenter authored and Theodore Ts'o committed Jul 30, 2011
1 parent 59be8e7 commit c49bafa
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions fs/ext4/resize.c
Original file line number Diff line number Diff line change
Expand Up @@ -517,6 +517,7 @@ static int add_new_gdb(handle_t *handle, struct inode *inode,
return err;

exit_inode:
kfree(n_group_desc);
/* ext4_handle_release_buffer(handle, iloc.bh); */
brelse(iloc.bh);
exit_dindj:
Expand Down

0 comments on commit c49bafa

Please sign in to comment.