From dae24d75047d31e922880d68cac57a61948b010f Mon Sep 17 00:00:00 2001 From: Cyrill Gorcunov Date: Sat, 28 Jun 2014 10:17:39 +0400 Subject: 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 --- preproc.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/preproc.c b/preproc.c index 9b114c2e..12b39782 100644 --- a/preproc.c +++ b/preproc.c @@ -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) -- cgit v1.2.1