Skip to content

Commit c49bafa

Browse files
error27tytso
authored andcommitted
ext4: add missing kfree() on error return path in add_new_gdb()
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>
1 parent 59be8e7 commit c49bafa

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

‎fs/ext4/resize.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -517,6 +517,7 @@ static int add_new_gdb(handle_t *handle, struct inode *inode,
517517
return err;
518518

519519
exit_inode:
520+
kfree(n_group_desc);
520521
/* ext4_handle_release_buffer(handle, iloc.bh); */
521522
brelse(iloc.bh);
522523
exit_dindj:

0 commit comments

Comments
 (0)