Skip to content
Snippets Groups Projects
Commit 1cee5907 authored by Daniel Salzman's avatar Daniel Salzman Committed by Gerrit Code Review
Browse files

hat-trie: fix resource leak (CID 1016415)

Change-Id: Ib6a65d4040911f224b3b83c8fad0265026eb4959
parent b28bd003
No related branches found
No related tags found
No related merge requests found
......@@ -748,8 +748,10 @@ int hattrie_find_lpr (hattrie_t* T, const char* key, size_t len, value_t** dst)
/* consume trie nodes for key (thus building prefix chain) */
node_ptr node = hattrie_find_ns(&ns, &sp, NODESTACK_INIT, &key, &len);
if (node.flag == NULL) {
if (sp == 0) /* empty trie, no prefix match */
if (sp == 0) { /* empty trie, no prefix match */
if (ns != bs) free(ns);
return -1;
}
node = ns[--sp]; /* dead end, pop node */
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment