From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from localhost (mandoc.bsd.lv [local]) by mandoc.bsd.lv (OpenSMTPD) with ESMTPA id 93dbda0e for ; Fri, 13 Mar 2020 11:17:28 -0500 (EST) Date: Fri, 13 Mar 2020 11:17:28 -0500 (EST) X-Mailinglist: mandoc-source Reply-To: source@mandoc.bsd.lv MIME-Version: 1.0 From: schwarze@mandoc.bsd.lv To: source@mandoc.bsd.lv Subject: mandoc: Properly reset the validation part of the tagging module between X-Mailer: activitymail 1.26, http://search.cpan.org/dist/activitymail/ Content-Type: text/plain; charset=utf-8 Message-ID: <11ff0e624ff015f5@mandoc.bsd.lv> Log Message: ----------- Properly reset the validation part of the tagging module between files. This fixes a crash in makewhatis(8) encountered by naddy@. Modified Files: -------------- mandoc: read.c tag.c Revision Data ------------- Index: read.c =================================================================== RCS file: /home/cvs/mandoc/mandoc/read.c,v retrieving revision 1.215 retrieving revision 1.216 diff -Lread.c -Lread.c -u -p -r1.215 -r1.216 --- read.c +++ read.c @@ -678,11 +678,13 @@ mparse_alloc(int options, enum mandoc_os void mparse_reset(struct mparse *curp) { + tag_free(); roff_reset(curp->roff); roff_man_reset(curp->man); free_buf_list(curp->secondary); curp->secondary = NULL; curp->gzip = 0; + tag_alloc(); } void Index: tag.c =================================================================== RCS file: /home/cvs/mandoc/mandoc/tag.c,v retrieving revision 1.28 retrieving revision 1.29 diff -Ltag.c -Ltag.c -u -p -r1.28 -r1.29 --- tag.c +++ tag.c @@ -59,6 +59,8 @@ tag_free(void) struct tag_entry *entry; unsigned int slot; + if (tag_data.info.free == NULL) + return; entry = ohash_first(&tag_data, &slot); while (entry != NULL) { free(entry->nodes); @@ -66,6 +68,7 @@ tag_free(void) entry = ohash_next(&tag_data, &slot); } ohash_delete(&tag_data); + tag_data.info.free = NULL; } /* -- To unsubscribe send an email to source+unsubscribe@mandoc.bsd.lv