mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-08-14 05:45:59 +03:00
Changes variables destructor to virtual
Avoid memory leak while destroying the Variable objects.
This commit is contained in:
parent
0c37ba336b
commit
557c29fd46
@ -64,6 +64,7 @@ class Variable {
|
|||||||
|
|
||||||
explicit Variable(std::string _name);
|
explicit Variable(std::string _name);
|
||||||
Variable(std::string name, VariableKind kind);
|
Variable(std::string name, VariableKind kind);
|
||||||
|
virtual ~Variable() { }
|
||||||
|
|
||||||
static std::string to_s(std::vector<Variable *> *variables);
|
static std::string to_s(std::vector<Variable *> *variables);
|
||||||
|
|
||||||
|
@ -34,6 +34,7 @@ class Count : public Variable {
|
|||||||
explicit Count(Variable *v)
|
explicit Count(Variable *v)
|
||||||
: Variable("count(" + v->m_name + ")"),
|
: Variable("count(" + v->m_name + ")"),
|
||||||
var(v) { }
|
var(v) { }
|
||||||
|
virtual ~Count() { delete var; }
|
||||||
|
|
||||||
void evaluateInternal(Transaction *transaction,
|
void evaluateInternal(Transaction *transaction,
|
||||||
std::vector<const collection::Variable *> *l) override;
|
std::vector<const collection::Variable *> *l) override;
|
||||||
|
@ -37,6 +37,8 @@ class Exclusion : public Variable {
|
|||||||
var(v)
|
var(v)
|
||||||
{ m_isExclusion = true; }
|
{ m_isExclusion = true; }
|
||||||
|
|
||||||
|
virtual ~Exclusion() { delete var; }
|
||||||
|
|
||||||
void evaluateInternal(Transaction *transaction,
|
void evaluateInternal(Transaction *transaction,
|
||||||
std::vector<const collection::Variable *> *l) override;
|
std::vector<const collection::Variable *> *l) override;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user