2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-29 05:28:00 +00:00

Merge branch '2420-xmlfreetextwriter-could-be-called-twice' into 'main'

Resolve "CID 316510: Memory - corruptions (USE_AFTER_FREE)"

Closes #2420

See merge request isc-projects/bind9!4613
This commit is contained in:
Mark Andrews 2021-01-28 05:19:53 +00:00
commit c1c7e1ac5c
2 changed files with 5 additions and 2 deletions

View File

@ -1,3 +1,6 @@
5572. [bug] Address potential double free in generatexml.
[GL #2420]
5571. [bug] If a zone had a non-builtin named allow-update acl
named failed to start. [GL #2413]

View File

@ -2336,12 +2336,12 @@ generatexml(named_server_t *server, uint32_t flags, int *buflen,
TRY0(xmlTextWriterEndElement(writer)); /* /statistics */
TRY0(xmlTextWriterEndDocument(writer));
xmlFreeTextWriter(writer);
xmlDocDumpFormatMemoryEnc(doc, buf, buflen, "UTF-8", 0);
if (*buf == NULL) {
goto cleanup;
}
xmlFreeTextWriter(writer);
xmlFreeDoc(doc);
return (ISC_R_SUCCESS);