From: Egor Date: Sun, 22 Oct 2023 21:36:37 +0000 (+0300) Subject: trie_findfirst: fix subtle bug with struct reusal X-Git-Url: https://git.patchysicp.xyz/?a=commitdiff_plain;h=921c32091f4832ebb12a05c729124bb9bcddf93e;p=patchyircd.git trie_findfirst: fix subtle bug with struct reusal --- diff --git a/src/map_trie.c b/src/map_trie.c index e91e082..2f2dc66 100644 --- a/src/map_trie.c +++ b/src/map_trie.c @@ -171,9 +171,9 @@ int map_findfirst(map_find_t *pf, map_t *root) { f = *pf = malloc(sizeof(*f)); if (!f) return -1; - f->_len = 0; } f->_n = *root; + f->_len = 0; if (f->_n->value) { f->key[f->_len] = '\0'; f->value = f->_n->value;