diff options
Diffstat (limited to 'radix-trie.c')
-rw-r--r-- | radix-trie.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/radix-trie.c b/radix-trie.c index 3cb1e91..678f3be 100644 --- a/radix-trie.c +++ b/radix-trie.c @@ -223,6 +223,11 @@ static struct radix_node *add(struct radix_node **trie, uint8_t bits, } if (!*trie) { + if (type & RNODE_IS_LEAF) { + errno = ENOENT; + return NULL; + } + *trie = new_node(key, cidr, bits); (*trie)->flags = type; return *trie; |