mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-08-13 13:26:01 +03:00
Fix: validateDTD compile fails if when libxml2 not installed
This commit is contained in:
parent
cb4d7ae371
commit
c11b28292d
2
CHANGES
2
CHANGES
@ -1,6 +1,8 @@
|
|||||||
v3.x.y - YYYY-MMM-DD (to be released)
|
v3.x.y - YYYY-MMM-DD (to be released)
|
||||||
-------------------------------------
|
-------------------------------------
|
||||||
|
|
||||||
|
- Fix: validateDTD compile fails if when libxml2 not installed
|
||||||
|
[Issue #3014 - @zangobot, @martinhsv]
|
||||||
- Fix memory leak of validateDTD's dtd object
|
- Fix memory leak of validateDTD's dtd object
|
||||||
[Issue #3008 - @martinhsv, @zimmerle]
|
[Issue #3008 - @martinhsv, @zimmerle]
|
||||||
- Fix memory leaks in ValidateSchema
|
- Fix memory leaks in ValidateSchema
|
||||||
|
@ -33,23 +33,23 @@
|
|||||||
namespace modsecurity {
|
namespace modsecurity {
|
||||||
namespace operators {
|
namespace operators {
|
||||||
|
|
||||||
|
#ifdef WITH_LIBXML2
|
||||||
class XmlDtdPtrManager {
|
class XmlDtdPtrManager {
|
||||||
public:
|
public:
|
||||||
/** @ingroup ModSecurity_Operator */
|
/** @ingroup ModSecurity_Operator */
|
||||||
explicit XmlDtdPtrManager(xmlDtdPtr dtd)
|
explicit XmlDtdPtrManager(xmlDtdPtr dtd)
|
||||||
: m_dtd(dtd) { }
|
: m_dtd(dtd) { }
|
||||||
~XmlDtdPtrManager() {
|
~XmlDtdPtrManager() {
|
||||||
#ifdef WITH_LIBXML2
|
|
||||||
if (m_dtd != NULL) {
|
if (m_dtd != NULL) {
|
||||||
xmlFreeDtd(m_dtd);
|
xmlFreeDtd(m_dtd);
|
||||||
m_dtd = NULL;
|
m_dtd = NULL;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
xmlDtdPtr get() const {return m_dtd;}
|
xmlDtdPtr get() const {return m_dtd;}
|
||||||
private:
|
private:
|
||||||
xmlDtdPtr m_dtd; // The resource being managed
|
xmlDtdPtr m_dtd; // The resource being managed
|
||||||
};
|
};
|
||||||
|
#endif
|
||||||
|
|
||||||
class ValidateDTD : public Operator {
|
class ValidateDTD : public Operator {
|
||||||
public:
|
public:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user