Commit e3a44fd7 authored by Linus Torvalds's avatar Linus Torvalds

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'
parents 408afb8d 84ae6f82
...@@ -241,6 +241,7 @@ parse_options(char *options, kuid_t *uid, kgid_t *gid, int *mode, int *reserved, ...@@ -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); affs_set_opt(*mount_opts, SF_NO_TRUNCATE);
break; break;
case Opt_prefix: case Opt_prefix:
kfree(*prefix);
*prefix = match_strdup(&args[0]); *prefix = match_strdup(&args[0]);
if (!*prefix) if (!*prefix)
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment