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)
|
||||
-------------------------------------
|
||||
|
||||
- Fix: validateDTD compile fails if when libxml2 not installed
|
||||
[Issue #3014 - @zangobot, @martinhsv]
|
||||
- Fix memory leak of validateDTD's dtd object
|
||||
[Issue #3008 - @martinhsv, @zimmerle]
|
||||
- Fix memory leaks in ValidateSchema
|
||||
|
@ -33,23 +33,23 @@
|
||||
namespace modsecurity {
|
||||
namespace operators {
|
||||
|
||||
#ifdef WITH_LIBXML2
|
||||
class XmlDtdPtrManager {
|
||||
public:
|
||||
/** @ingroup ModSecurity_Operator */
|
||||
explicit XmlDtdPtrManager(xmlDtdPtr dtd)
|
||||
: m_dtd(dtd) { }
|
||||
~XmlDtdPtrManager() {
|
||||
#ifdef WITH_LIBXML2
|
||||
if (m_dtd != NULL) {
|
||||
xmlFreeDtd(m_dtd);
|
||||
m_dtd = NULL;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
xmlDtdPtr get() const {return m_dtd;}
|
||||
private:
|
||||
xmlDtdPtr m_dtd; // The resource being managed
|
||||
};
|
||||
#endif
|
||||
|
||||
class ValidateDTD : public Operator {
|
||||
public:
|
||||
|
Loading…
x
Reference in New Issue
Block a user