From 6f38fe6cd51a62a2354fa735dba497a1b385a187 Mon Sep 17 00:00:00 2001 From: Cyrill Gorcunov Date: Thu, 11 Nov 2010 11:32:16 +0300 Subject: [PATCH] preproc: inc_fopen -- set sl->next early It's safer to init it early and be sure we not miss anything after. Signed-off-by: Cyrill Gorcunov --- preproc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/preproc.c b/preproc.c index df59cf05..7c85e5aa 100644 --- a/preproc.c +++ b/preproc.c @@ -1655,11 +1655,11 @@ static FILE *inc_fopen(const char *file, StrList **dhead, StrList ***dtail, while (1) { sl = nasm_malloc(prefix_len+len+1+sizeof sl->next); + sl->next = NULL; memcpy(sl->str, prefix, prefix_len); memcpy(sl->str+prefix_len, file, len+1); fp = fopen(sl->str, "r"); if (fp && dhead && !in_list(*dhead, sl->str)) { - sl->next = NULL; **dtail = sl; *dtail = &sl->next; } else {