mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-08-14 05:45:59 +03:00
Removes memory leak on the counter variable modificator
This commit is contained in:
parent
c49688fd7d
commit
e1d3abc8e7
@ -131,9 +131,15 @@ class VariableModificatorCount : public Variable {
|
||||
int count = 0;
|
||||
|
||||
m_var->evaluate(transaction, rule, &reslIn);
|
||||
for (auto &a : reslIn) {
|
||||
for (const collection::Variable *a : reslIn) {
|
||||
count++;
|
||||
if (a->m_dynamic) {
|
||||
delete a;
|
||||
a = NULL;
|
||||
}
|
||||
}
|
||||
reslIn.clear();
|
||||
|
||||
res = new std::string(std::to_string(count));
|
||||
|
||||
val = new collection::Variable(&m_name, res);
|
||||
|
Loading…
x
Reference in New Issue
Block a user