aboutsummaryrefslogtreecommitdiff
path: root/node.c
diff options
context:
space:
mode:
authorTucker Evans <tuckerevans24@gmail.com>2019-09-13 13:51:11 -0400
committerTucker Evans <tuckerevans24@gmail.com>2019-09-13 13:51:44 -0400
commit4b34d642384d6237c0af46fb48ec9e8bd98efad0 (patch)
treed18b41b22cfb8dba57ae5abfcf278ce2451200d1 /node.c
parent7698efc6e34037c3b6ba2968e77c4e33df4b484e (diff)
Add free_list to free all nodes in linked list
Diffstat (limited to 'node.c')
-rw-r--r--node.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/node.c b/node.c
index eaf4190..48826ca 100644
--- a/node.c
+++ b/node.c
@@ -54,8 +54,21 @@ node *n;
for(tmp = n; tmp;) {
n = tmp->next;
+
+ free(tmp->name);
+ tmp->name = NULL;
+
+ if (tmp->func_info)
+ free(tmp->func_info);
+ tmp->func_info = NULL;
+
+ if (tmp->array_info)
+ free(tmp->array_info);
+ tmp->array_info = NULL;
+
free(tmp);
tmp = NULL;
+
tmp = n;
}
}