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