aboutsummaryrefslogtreecommitdiff
path: root/trie.inc.h
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@lysator.liu.se>2019-02-04 18:23:51 +0100
committerHugo Hörnquist <hugo@lysator.liu.se>2019-02-05 18:16:17 +0100
commit14b33ae9c00f74a24a00aaece88b22af0955379e (patch)
treecee997634ecb0977e8f63fadfd6d00fdfdf89439 /trie.inc.h
parentNormalize and improve INIT & FREE macros. (diff)
downloadcalp-14b33ae9c00f74a24a00aaece88b22af0955379e.tar.gz
calp-14b33ae9c00f74a24a00aaece88b22af0955379e.tar.xz
Fix most memmory errors.
Diffstat (limited to 'trie.inc.h')
-rw-r--r--trie.inc.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/trie.inc.h b/trie.inc.h
index 14362058..8a817ab6 100644
--- a/trie.inc.h
+++ b/trie.inc.h
@@ -46,7 +46,7 @@ int TRIE_PUT(TYPE) ( TRIE(TYPE)* trie, char* key, TYPE* val ) {
last->child = t;
last = t;
}
- RESOLVE(TYPE)(&last->value, val);
+ last->value = RESOLVE(TYPE)(last->value, val);
// last->value = val;
return 0;
} else if (cur->c == subkey[0]) {
@@ -58,7 +58,7 @@ int TRIE_PUT(TYPE) ( TRIE(TYPE)* trie, char* key, TYPE* val ) {
} else if (subkey[0] == '\0') {
/* Key finished */
// last->value = val;
- RESOLVE(TYPE)(&last->value, val);
+ last->value = RESOLVE(TYPE)(last->value, val);
return 0;
} else if (cur->next != NULL) {
/* This node was not part of the set, but it's sibling might */