mirror of
https://github.com/netwide-assembler/nasm.git
synced 2025-02-17 17:19:35 +08:00
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:
parent
c31767c5cb
commit
dae24d7504
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user