summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCyrill Gorcunov <gorcunov@gmail.com>2018-12-25 13:11:55 +0300
committerCyrill Gorcunov <gorcunov@gmail.com>2018-12-25 13:11:55 +0300
commit532d9f9dcb3bea728debf38d75a12473e75cfdcc (patch)
tree3f4c6114ce42760a21cd3c06aa8d593a64c78d1c
parent5079ea0b015547e8e36e047968ed20832a487f18 (diff)
downloadnasm-532d9f9dcb3bea728debf38d75a12473e75cfdcc.tar.gz
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>
-rw-r--r--asm/listing.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/asm/listing.c b/asm/listing.c
index 4d753dbd..b79f11ae 100644
--- a/asm/listing.c
+++ b/asm/listing.c
@@ -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;
}