Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Chengguang Xu and committed by
David Sterba
84ae6f82 b5069438

+1
+1
fs/affs/super.c
··· 241 241 affs_set_opt(*mount_opts, SF_NO_TRUNCATE); 242 242 break; 243 243 case Opt_prefix: 244 + kfree(*prefix); 244 245 *prefix = match_strdup(&args[0]); 245 246 if (!*prefix) 246 247 return 0;