diff options
author | Sergey Poznyakoff <gray@gnu.org> | 2016-06-20 16:41:48 +0300 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org> | 2016-06-20 16:41:48 +0300 |
commit | 41d1f458d81f165ad918f986277c5e7007275b2f (patch) | |
tree | f7a383901a5fd47d81342990655006e1607f8536 /src | |
parent | 91610984e90d0062cb4ea50b37428559d5e4ede5 (diff) | |
download | grecs-41d1f458d81f165ad918f986277c5e7007275b2f.tar.gz grecs-41d1f458d81f165ad918f986277c5e7007275b2f.tar.bz2 |
Ensure grecs_preproc reentrancy after grecs_preproc_done
* src/preproc.c (grecs_preproc_done): Reset static variables after free.
Diffstat (limited to 'src')
-rw-r--r-- | src/preproc.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/preproc.c b/src/preproc.c index 183af3a..08b963a 100644 --- a/src/preproc.c +++ b/src/preproc.c @@ -653,9 +653,19 @@ void grecs_preproc_done() { grecs_symtab_free(incl_sources); + incl_sources = NULL; + grecs_free(linebuf); + linebuf = NULL; + bufsize = 0; + grecs_free(putback_buffer); + putback_buffer = NULL; + putback_size = putback_max = 0; + free(linebufbase); /* Allocated via standard malloc/realloc */ + linebufbase = NULL; + linebufsize = 0; } int |