diff options
author | Rakesh Pandit <rakesh@tuxera.com> | 2014-03-15 14:22:37 +0200 |
---|---|---|
committer | Chris Mason <clm@fb.com> | 2014-03-21 09:51:31 -0700 |
commit | bf357ff320f80eb1a47e0fd4d06be374e2f2b3fd (patch) | |
tree | 4caedd77c637799efde6d2ad8c0b6b98b296c0f7 | |
parent | 40af8f4ae778dd311a059db6cbfa52bb930fd052 (diff) |
Btrfs-progs: fsck: fix memory leak and unnecessary call to free
Free already allocated memory to item1_data if malloc fails for
item2_data in swap_values. Seems to be a typo from commit 70749a77.
Signed-off-by: Rakesh Pandit <rakesh@tuxera.com>
Signed-off-by: David Sterba <dsterba@suse.cz>
Signed-off-by: Chris Mason <clm@fb.com>
-rw-r--r-- | cmds-check.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/cmds-check.c b/cmds-check.c index d1cafe1d..60708d05 100644 --- a/cmds-check.c +++ b/cmds-check.c @@ -2380,7 +2380,7 @@ static int swap_values(struct btrfs_root *root, struct btrfs_path *path, return -ENOMEM; item2_data = malloc(item2_size); if (!item2_data) { - free(item2_data); + free(item1_data); return -ENOMEM; } |