summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2007-11-26 22:02:21 -0800
committerH. Peter Anvin <hpa@zytor.com>2007-11-26 22:03:53 -0800
commit7061ad73fec9b4f9f1bff2f0208014ffce325ec1 (patch)
treeb1151612d6a6e7fab1c7033411b2f86b3b6fa95f
parent00927db7e290691baee3d354d1537c464e9b2308 (diff)
downloadnasm-7061ad73fec9b4f9f1bff2f0208014ffce325ec1.tar.gz
BR 852464: Fix memory leak in %if/%elseif
-rw-r--r--preproc.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/preproc.c b/preproc.c
index 1de92855..8340ce44 100644
--- a/preproc.c
+++ b/preproc.c
@@ -2121,13 +2121,13 @@ static int do_directive(Token * tline)
else {
j = if_condition(tline->next, i);
tline->next = NULL; /* it got freed */
- free_tlist(origline);
j = j < 0 ? COND_NEVER : j ? COND_IF_TRUE : COND_IF_FALSE;
}
cond = nasm_malloc(sizeof(Cond));
cond->next = istk->conds;
cond->state = j;
istk->conds = cond;
+ free_tlist(origline);
return DIRECTIVE_FOUND;
CASE_PP_ELIF:
@@ -2147,10 +2147,10 @@ static int do_directive(Token * tline)
*/
j = if_condition(expand_mmac_params(tline->next), i);
tline->next = NULL; /* it got freed */
- free_tlist(origline);
istk->conds->state =
j < 0 ? COND_NEVER : j ? COND_IF_TRUE : COND_IF_FALSE;
}
+ free_tlist(origline);
return DIRECTIVE_FOUND;
case PP_ELSE: