Skip to content

Commit 3e36a16

Browse files
Wei Yongjuntytso
authored andcommitted
ext4: fix possible memory leak in ext4_remount()
'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 <yongjun_wei@trendmicro.com.cn> Signed-off-by: "Theodore Ts'o" <tytso@mit.edu> Reviewed-by: Lukas Czerner <lczerner@redhat.com> Cc: stable@vger.kernel.org
1 parent df05c1b commit 3e36a16

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

‎fs/ext4/super.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4543,6 +4543,7 @@ static int ext4_remount(struct super_block *sb, int *flags, char *data)
45434543
if (!old_opts.s_qf_names[i]) {
45444544
for (j = 0; j < i; j++)
45454545
kfree(old_opts.s_qf_names[j]);
4546+
kfree(orig_data);
45464547
return -ENOMEM;
45474548
}
45484549
} else

0 commit comments

Comments
 (0)