diff options
author | c+1 | 2023-10-10 11:26:44 -0400 |
---|---|---|
committer | c+1 | 2023-10-10 11:26:44 -0400 |
commit | 58c7a71a50318940e747c365cc3f207dba432977 (patch) | |
tree | 7d173f5433fba1b01c531610a0bf70684b8ca1de /src/token.c | |
parent | 78befa147eccfb169bf994da3d9bfba9be3631a6 (diff) |
fixed source.c, fixed preprocessor mem leaks, implemented new lexer
Diffstat (limited to 'src/token.c')
-rw-r--r-- | src/token.c | 6 |
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); } |