summaryrefslogtreecommitdiff
path: root/base/data-struct
diff options
context:
space:
mode:
authorZdenek Kabelac <zkabelac@redhat.com>2018-10-15 14:52:49 +0200
committerZdenek Kabelac <zkabelac@redhat.com>2018-10-15 17:49:44 +0200
commiteed8715e1d891665a6c9b8a39850e61f40ea453e (patch)
treef51e36a33f4e8f0d85e1203ece94a933fa5a990c /base/data-struct
parent20971f7034cbd329f873e08869bfb7acf3f1ac0e (diff)
downloadlvm2-eed8715e1d891665a6c9b8a39850e61f40ea453e.tar.gz
cov: fix missing null allocation check
Diffstat (limited to 'base/data-struct')
-rw-r--r--base/data-struct/radix-tree-adaptive.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/base/data-struct/radix-tree-adaptive.c b/base/data-struct/radix-tree-adaptive.c
index cd53dd600..cbe8302c3 100644
--- a/base/data-struct/radix-tree-adaptive.c
+++ b/base/data-struct/radix-tree-adaptive.c
@@ -265,7 +265,8 @@ static bool _insert_prefix_chain(struct radix_tree *rt, struct value *v, uint8_t
if (kb[i] != pc->prefix[i])
break;
- pc2 = zalloc(sizeof(*pc2) + pc->len - i);
+ if (!(pc2 = zalloc(sizeof(*pc2) + pc->len - i)))
+ return false;
pc2->len = pc->len - i;
memmove(pc2->prefix, pc->prefix + i, pc2->len);
pc2->child = pc->child;