aboutsummaryrefslogtreecommitdiff
path: root/src/token.c
diff options
context:
space:
mode:
authorc+12023-10-10 11:26:44 -0400
committerc+12023-10-10 11:26:44 -0400
commit58c7a71a50318940e747c365cc3f207dba432977 (patch)
tree7d173f5433fba1b01c531610a0bf70684b8ca1de /src/token.c
parent78befa147eccfb169bf994da3d9bfba9be3631a6 (diff)
fixed source.c, fixed preprocessor mem leaks, implemented new lexer
Diffstat (limited to 'src/token.c')
-rw-r--r--src/token.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/token.c b/src/token.c
index 26af598..ece32f4 100644
--- a/src/token.c
+++ b/src/token.c
@@ -14,6 +14,12 @@ token_t* token_init(int type, char* val) {
}
void token_destroy(token_t* token) {
+ if (token->nxt) {
+ token_destroy(token->nxt);
+ token->nxt = NULL;
+ }
+
+ free(token->val);
free(token);
}