From ef45c6b9db20bd4aa9cd0bb6f3f05cec41e21f96 Mon Sep 17 00:00:00 2001 From: David Sterba Date: Wed, 6 Jan 2016 15:52:11 +0100 Subject: [PATCH] btrfs-progs: handler memory allocation failure in add_extent_rec Signed-off-by: David Sterba --- cmds-check.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cmds-check.c b/cmds-check.c index 266451a..e751656 100644 --- a/cmds-check.c +++ b/cmds-check.c @@ -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); -- 2.7.4