aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org>2016-06-20 16:41:48 +0300
committerSergey Poznyakoff <gray@gnu.org>2016-06-20 16:41:48 +0300
commit41d1f458d81f165ad918f986277c5e7007275b2f (patch)
treef7a383901a5fd47d81342990655006e1607f8536 /src
parent91610984e90d0062cb4ea50b37428559d5e4ede5 (diff)
downloadgrecs-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.c10
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

Return to:

Send suggestions and report system problems to the System administrator.