diff options
Diffstat (limited to 'libcnary/node.c')
-rw-r--r-- | libcnary/node.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/libcnary/node.c b/libcnary/node.c index c24ca7a..6d68f6e 100644 --- a/libcnary/node.c +++ b/libcnary/node.c @@ -46,11 +46,10 @@ void node_destroy(node_t* node) { node_t* node_create(node_t* parent, void* data) { int error = 0; - node_t* node = (node_t*) malloc(sizeof(node_t)); - if(node == NULL) { + node_t* node = (node_t*)calloc(1, sizeof(node_t)); + if (node == NULL) { return NULL; } - memset(node, '\0', sizeof(node_t)); node->data = data; node->next = NULL; |