summaryrefslogtreecommitdiff
path: root/cmds-check.c
diff options
context:
space:
mode:
authorDavid Sterba <dsterba@suse.com>2016-01-06 15:52:11 +0100
committerDavid Sterba <dsterba@suse.com>2016-01-12 15:02:50 +0100
commitcb2b8b19c83ddb168b69307c4a68c2a2d39f2a5f (patch)
treec8ee4ba18de64dd1eb09e98a1d480902153f655c /cmds-check.c
parentb317ca97d3f6c2b2ef23b051d304c7f03e3c23f1 (diff)
downloadbtrfs-progs-cb2b8b19c83ddb168b69307c4a68c2a2d39f2a5f.tar.gz
btrfs-progs: catch memory allocation failure in splice_shared_node
Do the dumb BUG_ON now, the function needs more changes to handle all errors. Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'cmds-check.c')
-rw-r--r--cmds-check.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/cmds-check.c b/cmds-check.c
index 224bec0..bc594d5 100644
--- a/cmds-check.c
+++ b/cmds-check.c
@@ -1128,6 +1128,7 @@ again:
ins = node;
} else {
ins = malloc(sizeof(*ins));
+ BUG_ON(!ins);
ins->cache.start = node->cache.start;
ins->cache.size = node->cache.size;
ins->data = rec;