summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2008-06-04 15:11:23 -0700
committerH. Peter Anvin <hpa@zytor.com>2008-06-04 15:11:23 -0700
commitf2936d729f18aff49fa6db84ecf92ab5bc83268f (patch)
treec66ebb331569e927a7a42a0e63d3395a48bd7736
parent88c9e1f88cd1e67ad4fb2834f3cad6160d5a3fbb (diff)
downloadnasm-f2936d729f18aff49fa6db84ecf92ab5bc83268f.tar.gz
Fix double free in %depend
-rw-r--r--preproc.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/preproc.c b/preproc.c
index 40526729..475cb7e3 100644
--- a/preproc.c
+++ b/preproc.c
@@ -1840,7 +1840,7 @@ static int do_directive(Token * tline)
origline = tline;
skip_white_(tline);
- if (!tok_type_(tline, TOK_PREPROC_ID) ||
+ if (!tline || !tok_type_(tline, TOK_PREPROC_ID) ||
(tline->text[1] == '%' || tline->text[1] == '$'
|| tline->text[1] == '!'))
return NO_DIRECTIVE_FOUND;
@@ -2093,7 +2093,6 @@ static int do_directive(Token * tline)
if (!t || (t->type != TOK_STRING &&
t->type != TOK_INTERNAL_STRING)) {
error(ERR_NONFATAL, "`%%depend' expects a file name");
- free_tlist(t);
free_tlist(origline);
return DIRECTIVE_FOUND; /* but we did _something_ */
}
@@ -2110,7 +2109,6 @@ static int do_directive(Token * tline)
*deptail = sl;
deptail = &sl->next;
}
- free_tlist(t);
free_tlist(origline);
return DIRECTIVE_FOUND;