Skip to content

Commit

Permalink
Merge pull request #2760 from martinhsv/v2/master
Browse files Browse the repository at this point in the history
XML parser cleanup: NULL duplicate pointer
  • Loading branch information
martinhsv committed Jun 8, 2022
2 parents fc8e558 + dfbdaf8 commit 4136c4c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions apache2/msc_xml.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 4136c4c

Please sign in to comment.