Skip to content

Commit

Permalink
ext4: fix possible memory leak in ext4_remount()
Browse files Browse the repository at this point in the history
'orig_data' is malloced in ext4_remount() and should be freed
before leaving from the error handling cases, otherwise it will
cause memory leak.

Signed-off-by: Wei Yongjun <[email protected]>
Signed-off-by: "Theodore Ts'o" <[email protected]>
Reviewed-by: Lukas Czerner <[email protected]>
Cc: [email protected]
  • Loading branch information
Wei Yongjun authored and tytso committed Mar 2, 2013
1 parent df05c1b commit 3e36a16
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions fs/ext4/super.c
Original file line number Diff line number Diff line change
Expand Up @@ -4543,6 +4543,7 @@ static int ext4_remount(struct super_block *sb, int *flags, char *data)
if (!old_opts.s_qf_names[i]) {
for (j = 0; j < i; j++)
kfree(old_opts.s_qf_names[j]);
kfree(orig_data);
return -ENOMEM;
}
} else
Expand Down

0 comments on commit 3e36a16

Please sign in to comment.