listing: list_emit -- Don't forget to zap listerr_head

In list_emit we walk over listerr_head freeing the list,
but the head pointer remain carrying old value. Need
to clean it up once traverse is done to not access
already freed memory later.

https://bugzilla.nasm.us/show_bug.cgi?id=3392538

Reported-by: russvz@comcast.net
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
This commit is contained in:
Cyrill Gorcunov 2018-12-25 13:11:55 +03:00
parent 5079ea0b01
commit 532d9f9dcb

View File

@ -128,6 +128,7 @@ static void list_emit(void)
fprintf(listfp, " %s\n", le->str);
nasm_free(le);
}
listerr_head = NULL;
listerr_tail = &listerr_head;
}