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 | |
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.
-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 | |||
653 | grecs_preproc_done() | 653 | grecs_preproc_done() |
654 | { | 654 | { |
655 | grecs_symtab_free(incl_sources); | 655 | grecs_symtab_free(incl_sources); |
656 | incl_sources = NULL; | ||
657 | |||
656 | grecs_free(linebuf); | 658 | grecs_free(linebuf); |
659 | linebuf = NULL; | ||
660 | bufsize = 0; | ||
661 | |||
657 | grecs_free(putback_buffer); | 662 | grecs_free(putback_buffer); |
663 | putback_buffer = NULL; | ||
664 | putback_size = putback_max = 0; | ||
665 | |||
658 | free(linebufbase); /* Allocated via standard malloc/realloc */ | 666 | free(linebufbase); /* Allocated via standard malloc/realloc */ |
667 | linebufbase = NULL; | ||
668 | linebufsize = 0; | ||
659 | } | 669 | } |
660 | 670 | ||
661 | int | 671 | int |