mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-09-29 11:16:33 +03:00
Moving the rules deletion to the RuleProperties class
The deletion was happning on the Rule class due to historical reasons. The consequence of that was a parser memory leak.
This commit is contained in:
committed by
Felipe Zimmerle
parent
068a3eb517
commit
a8e5cce744
@@ -41,7 +41,7 @@ class Action {
|
||||
: action_kind(2),
|
||||
m_isNone(false),
|
||||
m_name(""),
|
||||
m_referenceCount(0),
|
||||
m_referenceCount(1),
|
||||
m_parser_payload(""),
|
||||
temporaryAction(false) {
|
||||
set_name_and_payload(_action);
|
||||
@@ -50,7 +50,7 @@ class Action {
|
||||
: action_kind(kind),
|
||||
m_isNone(false),
|
||||
m_name(""),
|
||||
m_referenceCount(0),
|
||||
m_referenceCount(1),
|
||||
m_parser_payload(""),
|
||||
temporaryAction(false) {
|
||||
set_name_and_payload(_action);
|
||||
@@ -91,11 +91,13 @@ class Action {
|
||||
}
|
||||
}
|
||||
|
||||
void refCountDecreaseAndCheck() {
|
||||
int refCountDecreaseAndCheck() {
|
||||
this->m_referenceCount--;
|
||||
if (this->m_referenceCount == 0) {
|
||||
delete this;
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
void refCountIncrease() {
|
||||
|
Reference in New Issue
Block a user