diff options
author | H. Peter Anvin <hpa@zytor.com> | 2007-11-26 22:02:21 -0800 |
---|---|---|
committer | H. Peter Anvin <hpa@zytor.com> | 2007-11-26 22:03:53 -0800 |
commit | 7061ad73fec9b4f9f1bff2f0208014ffce325ec1 (patch) | |
tree | b1151612d6a6e7fab1c7033411b2f86b3b6fa95f | |
parent | 00927db7e290691baee3d354d1537c464e9b2308 (diff) | |
download | nasm-7061ad73fec9b4f9f1bff2f0208014ffce325ec1.tar.gz |
BR 852464: Fix memory leak in %if/%elseif
-rw-r--r-- | preproc.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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: |