summaryrefslogtreecommitdiff
path: root/preproc.c
diff options
context:
space:
mode:
authorCyrill Gorcunov <gorcunov@gmail.com>2011-03-03 09:18:56 +0300
committerCyrill Gorcunov <gorcunov@gmail.com>2011-03-05 23:54:49 +0300
commit8dcfd883c76b248fcafea2bda6e71acac9e7c052 (patch)
tree11570dfccb7e7a88ca3e568f78de05c2d749fc4e /preproc.c
parenta5c99123031c36650e03116492a6bcd338d42a30 (diff)
downloadnasm-8dcfd883c76b248fcafea2bda6e71acac9e7c052.tar.gz
nasm-8dcfd883c76b248fcafea2bda6e71acac9e7c052.tar.bz2
nasm-8dcfd883c76b248fcafea2bda6e71acac9e7c052.zip
preproc.c: Fix use-after-free bug
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Diffstat (limited to 'preproc.c')
-rw-r--r--preproc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/preproc.c b/preproc.c
index 2f3dda4..75f9980 100644
--- a/preproc.c
+++ b/preproc.c
@@ -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();