mirror of
https://github.com/kdave/btrfs-progs
synced 2024-12-26 16:12:34 +00:00
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:
parent
40af8f4ae7
commit
bf357ff320
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user