btrfs-progs: handler memory allocation failure in add_extent_rec

Signed-off-by: David Sterba <dsterba@suse.com>
master
David Sterba 2016-01-06 15:52:11 +01:00
parent 87296b5541
commit ef45c6b9db
1 changed files with 2 additions and 0 deletions

View File

@ -4586,6 +4586,8 @@ static int add_extent_rec(struct cache_tree *extent_cache,
return ret;
}
rec = malloc(sizeof(*rec));
if (!rec)
return -ENOMEM;
rec->start = start;
rec->max_size = max_size;
rec->nr = max(nr, max_size);