aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2018-06-04 14:27:09 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2018-06-04 14:27:09 -0700
commite3a44fd7e63321338f652714c20a4c75bed9f60b (patch)
treebdc0cc283700a98e1dd94626a7db7e63e7af3ef5
parentMerge branch 'work.aio-1' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs (diff)
parentaffs: fix potential memory leak when parsing option 'prefix' (diff)
downloadlinux-dev-e3a44fd7e63321338f652714c20a4c75bed9f60b.tar.xz
linux-dev-e3a44fd7e63321338f652714c20a4c75bed9f60b.zip
Merge tag 'affs-for-4.18-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux
Pull affs fix from David Sterba: "A potential memory leak fix for AFFS" * tag 'affs-for-4.18-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux: affs: fix potential memory leak when parsing option 'prefix'
-rw-r--r--fs/affs/super.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/affs/super.c b/fs/affs/super.c
index e602619aed9d..d1ad11a8a4a5 100644
--- a/fs/affs/super.c
+++ b/fs/affs/super.c
@@ -241,6 +241,7 @@ parse_options(char *options, kuid_t *uid, kgid_t *gid, int *mode, int *reserved,
affs_set_opt(*mount_opts, SF_NO_TRUNCATE);
break;
case Opt_prefix:
+ kfree(*prefix);
*prefix = match_strdup(&args[0]);
if (!*prefix)
return 0;