Skip to content

Commit dfbdaf8

Browse files
committed
XML parser cleanup: NULL duplicate pointer
1 parent fc8e558 commit dfbdaf8

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

apache2/msc_xml.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,9 @@ apr_status_t xml_cleanup(modsec_rec *msr) {
140140
if (msr->xml->parsing_ctx != NULL) {
141141
if (msr->xml->parsing_ctx->myDoc) {
142142
xmlFreeDoc(msr->xml->parsing_ctx->myDoc);
143+
if (msr->xml->parsing_ctx->myDoc == msr->xml->doc) {
144+
msr->xml->doc = NULL;
145+
}
143146
}
144147
xmlFreeParserCtxt(msr->xml->parsing_ctx);
145148
msr->xml->parsing_ctx = NULL;

0 commit comments

Comments
 (0)