Skip to content

Commit

Permalink
Btrfs: fix memory leak in btrfs_parse_early_options()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Ilya Dryomov committed Nov 9, 2011
1 parent 7fd2ae2 commit a90e8b6
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions fs/btrfs/super.c
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit a90e8b6

Please sign in to comment.