diff options
author | Hugo Hörnquist <hugo@lysator.liu.se> | 2019-02-04 18:23:51 +0100 |
---|---|---|
committer | Hugo Hörnquist <hugo@lysator.liu.se> | 2019-02-05 18:16:17 +0100 |
commit | 14b33ae9c00f74a24a00aaece88b22af0955379e (patch) | |
tree | cee997634ecb0977e8f63fadfd6d00fdfdf89439 /trie.inc.h | |
parent | Normalize and improve INIT & FREE macros. (diff) | |
download | calp-14b33ae9c00f74a24a00aaece88b22af0955379e.tar.gz calp-14b33ae9c00f74a24a00aaece88b22af0955379e.tar.xz |
Fix most memmory errors.
Diffstat (limited to '')
-rw-r--r-- | trie.inc.h | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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 */ |