diff options
author | Ilya Dryomov <idryomov@gmail.com> | 2011-11-08 09:47:55 -0500 |
---|---|---|
committer | Ilya Dryomov <idryomov@gmail.com> | 2011-11-09 15:53:38 -0500 |
commit | a90e8b6fb80db43b029e1e76205452afa8bdc77a (patch) | |
tree | 98a546a79e439f984f43c15f1cd6fecc8a082412 /fs/btrfs | |
parent | 7fd2ae21a42d178982679b86086661292b4afe4a (diff) |
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>
Diffstat (limited to 'fs/btrfs')
-rw-r--r-- | fs/btrfs/super.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c index dcd5aef6b614..6befcaf253bd 100644 --- a/fs/btrfs/super.c +++ b/fs/btrfs/super.c | |||
@@ -448,6 +448,7 @@ static int btrfs_parse_early_options(const char *options, fmode_t flags, | |||
448 | token = match_token(p, tokens, args); | 448 | token = match_token(p, tokens, args); |
449 | switch (token) { | 449 | switch (token) { |
450 | case Opt_subvol: | 450 | case Opt_subvol: |
451 | kfree(*subvol_name); | ||
451 | *subvol_name = match_strdup(&args[0]); | 452 | *subvol_name = match_strdup(&args[0]); |
452 | break; | 453 | break; |
453 | case Opt_subvolid: | 454 | case Opt_subvolid: |