]> sourceware.org Git - lvm2.git/commitdiff
cov: fix missing null allocation check
authorZdenek Kabelac <zkabelac@redhat.com>
Mon, 15 Oct 2018 12:52:49 +0000 (14:52 +0200)
committerZdenek Kabelac <zkabelac@redhat.com>
Mon, 15 Oct 2018 15:49:44 +0000 (17:49 +0200)
base/data-struct/radix-tree-adaptive.c

index cd53dd6005620dfc4f1b0a584f399f41d91e100a..cbe8302c33f5d851423a71e35b36cbcf96b46a3f 100644 (file)
@@ -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;
This page took 0.710416 seconds and 5 git commands to generate.