diff options
author | Wei Yongjun <yongjun_wei@trendmicro.com.cn> | 2013-03-02 17:13:55 -0500 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2013-03-02 17:13:55 -0500 |
commit | 3e36a16375eee390a9d80f99499fe630efa08128 (patch) | |
tree | c07bece14821d3b66c781b969c4ec0ed5ee37a26 /fs/ext4/super.c | |
parent | df05c1b85a88888b92725ef27ba70086f38fb083 (diff) | |
download | linux-3.10-3e36a16375eee390a9d80f99499fe630efa08128.tar.gz linux-3.10-3e36a16375eee390a9d80f99499fe630efa08128.tar.bz2 linux-3.10-3e36a16375eee390a9d80f99499fe630efa08128.zip |
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
Diffstat (limited to 'fs/ext4/super.c')
-rw-r--r-- | fs/ext4/super.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/ext4/super.c b/fs/ext4/super.c index 1ae5860b30a..6ac9c8a3eb0 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 |