diff options
-rw-r--r-- | base/data-struct/radix-tree-adaptive.c | 3 |
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; |