Merge pull request #2760 from martinhsv/v2/master

XML parser cleanup: NULL duplicate pointer
This commit is contained in:
martinhsv 2022-06-08 18:41:21 -04:00 committed by GitHub
commit 4136c4c46b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -140,6 +140,9 @@ apr_status_t xml_cleanup(modsec_rec *msr) {
if (msr->xml->parsing_ctx != NULL) {
if (msr->xml->parsing_ctx->myDoc) {
xmlFreeDoc(msr->xml->parsing_ctx->myDoc);
if (msr->xml->parsing_ctx->myDoc == msr->xml->doc) {
msr->xml->doc = NULL;
}
}
xmlFreeParserCtxt(msr->xml->parsing_ctx);
msr->xml->parsing_ctx = NULL;