preproc: pp_cleanup -- Don't forget to zeroify variables

Once we free allocated memory don't forget to setup variables
to NULL, otherwise they are pointing into nonexisting memory,
which might lead into sigsegv in best case.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
This commit is contained in:
Cyrill Gorcunov 2014-06-28 10:17:39 +04:00
parent c31767c5cb
commit dae24d7504

View File

@ -1184,6 +1184,7 @@ static void delete_Blocks(void)
if (a != &blocks)
nasm_free(a);
}
memset(&blocks, 0, sizeof(blocks));
}
/*
@ -5141,7 +5142,9 @@ static void pp_cleanup(int pass)
if (pass == 0) {
IncPath *i;
free_llist(predef);
predef = NULL;
delete_Blocks();
freeTokens = NULL;
while ((i = ipath)) {
ipath = i->next;
if (i->path)