From: nasm-bot f. C. G. <gor...@gm...> - 2014-06-28 20:57:20
|
Commit-ID: dae24d75047d31e922880d68cac57a61948b010f Gitweb: http://repo.or.cz/w/nasm.git?a=commitdiff;h=dae24d75047d31e922880d68cac57a61948b010f Author: Cyrill Gorcunov <gor...@gm...> AuthorDate: Sat, 28 Jun 2014 10:17:39 +0400 Committer: Cyrill Gorcunov <gor...@gm...> CommitDate: Sun, 29 Jun 2014 00:52:54 +0400 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 <gor...@gm...> --- preproc.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/preproc.c b/preproc.c index 9b114c2..12b3978 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) |