Skip to content

Commit c11b282

Browse files
committed
Fix: validateDTD compile fails if when libxml2 not installed
1 parent cb4d7ae commit c11b282

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

CHANGES

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
v3.x.y - YYYY-MMM-DD (to be released)
22
-------------------------------------
33

4+
- Fix: validateDTD compile fails if when libxml2 not installed
5+
[Issue #3014 - @zangobot, @martinhsv]
46
- Fix memory leak of validateDTD's dtd object
57
[Issue #3008 - @martinhsv, @zimmerle]
68
- Fix memory leaks in ValidateSchema

src/operators/validate_dtd.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -33,23 +33,23 @@
3333
namespace modsecurity {
3434
namespace operators {
3535

36+
#ifdef WITH_LIBXML2
3637
class XmlDtdPtrManager {
3738
public:
3839
/** @ingroup ModSecurity_Operator */
3940
explicit XmlDtdPtrManager(xmlDtdPtr dtd)
4041
: m_dtd(dtd) { }
4142
~XmlDtdPtrManager() {
42-
#ifdef WITH_LIBXML2
4343
if (m_dtd != NULL) {
4444
xmlFreeDtd(m_dtd);
4545
m_dtd = NULL;
4646
}
47-
#endif
4847
}
4948
xmlDtdPtr get() const {return m_dtd;}
5049
private:
5150
xmlDtdPtr m_dtd; // The resource being managed
5251
};
52+
#endif
5353

5454
class ValidateDTD : public Operator {
5555
public:

0 commit comments

Comments
 (0)