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>
This commit is contained in:
Rakesh Pandit 2014-03-15 14:22:37 +02:00 committed by Chris Mason
parent 40af8f4ae7
commit bf357ff320

View File

@ -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;
}