mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-26 10:49:33 +00:00
Btrfs: fix memory leak in btrfs_parse_early_options()
Don't leak subvol_name string in case multiple subvol= options are given. "The lastest option is effective" behavior (consistent with subvolid= and subvolrootid= options) is preserved. Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
This commit is contained in:
parent
7fd2ae21a4
commit
a90e8b6fb8
1 changed files with 1 additions and 0 deletions
|
@ -448,6 +448,7 @@ static int btrfs_parse_early_options(const char *options, fmode_t flags,
|
|||
token = match_token(p, tokens, args);
|
||||
switch (token) {
|
||||
case Opt_subvol:
|
||||
kfree(*subvol_name);
|
||||
*subvol_name = match_strdup(&args[0]);
|
||||
break;
|
||||
case Opt_subvolid:
|
||||
|
|
Loading…
Reference in a new issue