aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTucker Evans <tuckerevans24@gmail.com>2019-09-23 13:36:33 -0400
committerTucker Evans <tuckerevans24@gmail.com>2019-09-23 13:36:33 -0400
commite450aa68aff14eaf4f184130e2dc9145abad710f (patch)
tree16248cdddb27351643943d39855982eabb74008e
parent944512372b71c0a03639264896e791d80e3b0143 (diff)
Fix node freeing
-rw-r--r--node.c10
1 files 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;