diff options
author | Jonas Gunz <himself@jonasgunz.de> | 2020-06-23 08:17:55 +0200 |
---|---|---|
committer | Jonas Gunz <himself@jonasgunz.de> | 2020-06-23 08:17:55 +0200 |
commit | fce8bc76bd976e2e2d08d530a462b2c8c73da020 (patch) | |
tree | b65c4b4e6b74f9f99ec0776a16c4db88066cc4e6 | |
parent | d200c07d66ffb61e4cceb8e6c4a37d8d264cb918 (diff) | |
download | dns-fce8bc76bd976e2e2d08d530a462b2c8c73da020.tar.gz |
added memset to avoid uninit. mem in tree_insert()
-rw-r--r-- | src/tree.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -25,7 +25,8 @@ int tree_insert ( struct tree_node** _root, char* _key, void* _data ) *node = malloc (sizeof(typeof(**node))); if( ! *node ) - return 1; + return 2; + memset ( *node, 0, sizeof(typeof(**node)) ); (*node)->key = _key; (*node)->data = _data; |