master - cov: fix missing null allocation check
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=eed8715e1d891665a6c9b8a39850e61f40ea453e Commit: eed8715e1d891665a6c9b8a39850e61f40ea453e Parent: 20971f7034cbd329f873e08869bfb7acf3f1ac0e Author: Zdenek Kabelac <[email protected]> AuthorDate: Mon Oct 15 14:52:49 2018 +0200 Committer: Zdenek Kabelac <[email protected]> CommitterDate: Mon Oct 15 17:49:44 2018 +0200
cov: fix missing null allocation check
--- base/data-struct/radix-tree-adaptive.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-)
base/data-struct/radix-tree-adaptive.c +2 -1
@@ -265,7 +265,8 @@ static bool _insert_prefix_chain(struct radix_tree *rt, struct value *v, uint8_tif (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;