From: Wei Yongjun Date: Sat, 2 Mar 2013 22:13:55 +0000 (-0500) Subject: ext4: fix possible memory leak in ext4_remount() X-Git-Tag: v3.9-rc1~14^2~4 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=3e36a16375eee390a9d80f99499fe630efa08128;p=karo-tx-linux.git 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 Signed-off-by: "Theodore Ts'o" Reviewed-by: Lukas Czerner Cc: stable@vger.kernel.org --- diff --git a/fs/ext4/super.c b/fs/ext4/super.c index 1ae5860b30a3..6ac9c8a3eb08 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c @@ -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