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