preproc.c: Fix use-after-free bug

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
This commit is contained in:
Cyrill Gorcunov 2011-03-03 09:18:56 +03:00
parent a5c9912303
commit 8dcfd883c7

View File

@ -5324,12 +5324,12 @@ static void pp_cleanup(int pass)
istk = istk->next;
fclose(i->fp);
nasm_free(i->fname);
nasm_free(i);
while (i->expansion != NULL) {
ExpInv *ei = i->expansion;
i->expansion = ei->prev;
free_expinv(ei);
}
nasm_free(i);
}
while (cstk)
ctx_pop();