mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-08-14 05:45:59 +03:00
parent
30364628a0
commit
41bf7f716b
@ -16,6 +16,9 @@
|
||||
#include <ctime>
|
||||
#include <iostream>
|
||||
|
||||
#include <libxml/xmlschemas.h>
|
||||
#include <libxml/xpath.h>
|
||||
|
||||
#include "modsecurity/modsecurity.h"
|
||||
#include "modsecurity/rule.h"
|
||||
#include "modsecurity/rule_message.h"
|
||||
@ -72,6 +75,7 @@ ModSecurity::ModSecurity()
|
||||
srand(time(NULL));
|
||||
#ifdef MSC_WITH_CURL
|
||||
curl_global_init(CURL_GLOBAL_ALL);
|
||||
xmlInitParser();
|
||||
#endif
|
||||
}
|
||||
|
||||
@ -83,6 +87,8 @@ ModSecurity::~ModSecurity() {
|
||||
#ifdef WITH_GEOIP
|
||||
Utils::GeoLookup::getInstance().cleanUp();
|
||||
#endif
|
||||
xmlCleanupParser();
|
||||
|
||||
delete m_global_collection;
|
||||
delete m_resource_collection;
|
||||
delete m_ip_collection;
|
||||
|
@ -140,6 +140,8 @@ bool ValidateSchema::evaluate(Transaction *t,
|
||||
t->debug(4, "XML: Successfully validated payload against " \
|
||||
"Schema: " + m_resource);
|
||||
#endif
|
||||
xmlSchemaFree(m_schema);
|
||||
xmlSchemaFreeParserCtxt(m_parserCtx);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
@ -33,6 +33,10 @@ XML::XML(Transaction *transaction)
|
||||
|
||||
|
||||
XML::~XML() {
|
||||
if (m_data.parsing_ctx != NULL) {
|
||||
xmlFreeParserCtxt(m_data.parsing_ctx);
|
||||
m_data.parsing_ctx = NULL;
|
||||
}
|
||||
if (m_data.doc != NULL) {
|
||||
xmlFreeDoc(m_data.doc);
|
||||
m_data.doc = NULL;
|
||||
|
Loading…
x
Reference in New Issue
Block a user