aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libtcc.c1
-rw-r--r--tccpp.c5
2 files changed, 5 insertions, 1 deletions
diff --git a/libtcc.c b/libtcc.c
index e5eefe4..10d2387 100644
--- a/libtcc.c
+++ b/libtcc.c
@@ -888,6 +888,7 @@ static void tcc_cleanup(void)
for(i = 0; i < n; i++)
tcc_free(table_ident[i]);
tcc_free(table_ident);
+ table_ident = NULL;
/* free sym_pools */
dynarray_reset(&sym_pools, &nb_sym_pools);
diff --git a/tccpp.c b/tccpp.c
index 82168f7..45e394f 100644
--- a/tccpp.c
+++ b/tccpp.c
@@ -3165,7 +3165,10 @@ ST_FUNC void preprocess_new(void)
isidnum_table[i-CH_EOF] = isid(i) || isnum(i);
/* add all tokens */
- table_ident = NULL;
+ if (table_ident) {
+ tcc_free (table_ident);
+ table_ident = NULL;
+ }
memset(hash_ident, 0, TOK_HASH_SIZE * sizeof(TokenSym *));
tok_ident = TOK_IDENT;