From patchwork Wed Feb 27 05:18:53 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: ext4: fix possible memory leak in ext4_remount() Date: Tue, 26 Feb 2013 19:18:53 -0000 From: Wei Yongjun X-Patchwork-Id: 223501 Message-Id: To: tytso@mit.edu, adilger.kernel@dilger.ca Cc: yongjun_wei@trendmicro.com.cn, linux-ext4@vger.kernel.org From: Wei Yongjun '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 Reviewed-by: Lukas Czerner --- fs/ext4/super.c | 1 + 1 file changed, 1 insertion(+) -- To unsubscribe from this list: send the line "unsubscribe linux-ext4" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/fs/ext4/super.c b/fs/ext4/super.c index 373d46c..8ae09e3 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c @@ -4538,6 +4538,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