提交 84ae6f82 编写于 作者: C Chengguang Xu 提交者: David Sterba

affs: fix potential memory leak when parsing option 'prefix'

When specifying option 'prefix' multiple times, current option parsing
will cause memory leak.  Hence, call kfree for previous one in this
case.
Signed-off-by: NChengguang Xu <cgxu519@gmx.com>
Signed-off-by: NDavid Sterba <dsterba@suse.com>
上级 b5069438
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册