aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar Jonas Gunz <himself@jonasgunz.de> 2020-06-23 08:17:55 +0200
committerGravatar Jonas Gunz <himself@jonasgunz.de> 2020-06-23 08:17:55 +0200
commitfce8bc76bd976e2e2d08d530a462b2c8c73da020 (patch)
treeb65c4b4e6b74f9f99ec0776a16c4db88066cc4e6 /src
parentd200c07d66ffb61e4cceb8e6c4a37d8d264cb918 (diff)
downloaddns-fce8bc76bd976e2e2d08d530a462b2c8c73da020.tar.gz
added memset to avoid uninit. mem in tree_insert()
Diffstat (limited to 'src')
-rw-r--r--src/tree.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/tree.c b/src/tree.c
index 5706c4c..479e2a6 100644
--- a/src/tree.c
+++ b/src/tree.c
@@ -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;