1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

cov: fix missing null allocation check

This commit is contained in:
Zdenek Kabelac 2018-10-15 14:52:49 +02:00
parent 20971f7034
commit eed8715e1d

View 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;