From e450aa68aff14eaf4f184130e2dc9145abad710f Mon Sep 17 00:00:00 2001 From: Tucker Evans Date: Mon, 23 Sep 2019 13:36:33 -0400 Subject: Fix node freeing --- node.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/node.c b/node.c index df56c6f..bde1ed6 100644 --- a/node.c +++ b/node.c @@ -52,8 +52,13 @@ node *n; free(n->name); n->name = NULL; - if (n->func_info) + if (n->func_info) { + if(n->func_info->argv) + free(n->func_info->argv); + n->func_info->argv = NULL; + free(n->func_info); + } n->func_info = NULL; if (n->array_info) @@ -69,7 +74,8 @@ node *n; { node *tmp; - for(tmp = n; tmp;) { + tmp = n; + while(tmp) { n = tmp->next; free_node(tmp); tmp = n; -- cgit v1.1