Skip to content

Commit 84ae6f8

Browse files
Chengguang Xukdave
authored andcommitted
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: Chengguang Xu <cgxu519@gmx.com> Signed-off-by: David Sterba <dsterba@suse.com>
1 parent b506943 commit 84ae6f8

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

‎fs/affs/super.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,7 @@ parse_options(char *options, kuid_t *uid, kgid_t *gid, int *mode, int *reserved,
241241
affs_set_opt(*mount_opts, SF_NO_TRUNCATE);
242242
break;
243243
case Opt_prefix:
244+
kfree(*prefix);
244245
*prefix = match_strdup(&args[0]);
245246
if (!*prefix)
246247
return 0;

0 commit comments

Comments
 (0)