aboutsummaryrefslogtreecommitdiffstats
path: root/src/utils
diff options
context:
space:
mode:
Diffstat (limited to 'src/utils')
-rw-r--r--src/utils/trie.c2
-rw-r--r--src/utils/utils.h1
2 files changed, 3 insertions, 0 deletions
diff --git a/src/utils/trie.c b/src/utils/trie.c
index f447860..b92573f 100644
--- a/src/utils/trie.c
+++ b/src/utils/trie.c
@@ -38,6 +38,8 @@ b_trie_free_node(b_trie_t *trie, b_trie_node_t *node)
void
b_trie_free(b_trie_t *trie)
{
+ if (trie == NULL)
+ return;
b_trie_free_node(trie, trie->root);
free(trie);
}
diff --git a/src/utils/utils.h b/src/utils/utils.h
index 20259d8..55b9c59 100644
--- a/src/utils/utils.h
+++ b/src/utils/utils.h
@@ -10,6 +10,7 @@
#define _UTILS_UTILS_H
#include <stdbool.h>
+#include <stdlib.h>
#include <stdarg.h>
#define B_STRING_CHUNK_SIZE 128