static void trie_node_cleanup(struct trie_node *node) { size_t i; for (i = 0; i < node->children_count; i++) trie_node_cleanup(node->children[i].child); free(node->children); free(node->values); free(node); }
static void trie_free(struct trie *trie) { if (!trie) return; if (trie->root) trie_node_cleanup(trie->root); strbuf_cleanup(trie->strings); free(trie); }