Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3e36a163 authored by Wei Yongjun's avatar Wei Yongjun Committed by Theodore Ts'o
Browse files

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: default avatarWei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: default avatar"Theodore Ts'o" <tytso@mit.edu>
Reviewed-by: default avatarLukas Czerner <lczerner@redhat.com>
Cc: stable@vger.kernel.org
parent df05c1b8
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -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