summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCyrill Gorcunov <gorcunov@gmail.com>2010-02-14 17:19:38 +0300
committerCyrill Gorcunov <gorcunov@gmail.com>2010-02-14 17:27:10 +0300
commita327c65d28fa31f924166f3b5da7feaa73cc124c (patch)
tree3d6f79b19e95da11187531c7df4076da0db47c12
parentbebf0d2157951250d91390fceac8a51fbc08c3a1 (diff)
downloadnasm-a327c65d28fa31f924166f3b5da7feaa73cc124c.tar.gz
preproc.c: Fix SIGSEV on missed %endm
In case if EOF is reached (or due to any other case pp_cleanup is being called) we do free "defining" macro but forgot to set pointer to NULL itself which leads to attempt to free memory again for this macro on further pp_cleanup calls.
-rw-r--r--preproc.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/preproc.c b/preproc.c
index fcec93d6..bbe2dae9 100644
--- a/preproc.c
+++ b/preproc.c
@@ -4804,6 +4804,7 @@ static void pp_cleanup(int pass)
}
free_mmacro(defining);
+ defining = NULL;
}
while (cstk)
ctx_pop();