Fix two rule-reload memory leak issues

This commit is contained in:
Martin Vierula 2022-09-15 13:44:40 -07:00
parent 17f3bb0b36
commit e9a7ba4a60
4 changed files with 14 additions and 2 deletions

View File

@ -1,6 +1,8 @@
v3.x.y - YYYY-MMM-DD (to be released)
-------------------------------------
- Fix two rule-reload memory leak issues
[Issue #2801 - @Abce, @martinhsv]
- Correct whitespace handling for Include directive
[Issue #2800 - @877509395, @martinhsv]

View File

@ -86,6 +86,8 @@ class Rule {
return *this;
}
virtual ~Rule() {}
virtual bool evaluate(Transaction *transaction) = 0;
virtual bool evaluate(Transaction *transaction,

View File

@ -80,6 +80,10 @@ RuleWithActions::RuleWithActions(
m_containsStaticBlockAction(false),
m_isChained(false) {
if (transformations != NULL) {
delete transformations;
}
if (actions) {
for (Action *a : *actions) {
if (a->action_kind == Action::ConfigurationKind) {

View File

@ -55,8 +55,8 @@ danglingTempReference:src/modsecurity.cc:206
knownConditionTrueFalse:src/operators/validate_url_encoding.cc:77
knownConditionTrueFalse:src/operators/verify_svnr.cc:87
rethrowNoCurrentException:headers/modsecurity/transaction.h:309
rethrowNoCurrentException:src/rule_with_actions.cc:123
ctunullpointer:src/rule_with_actions.cc:237
rethrowNoCurrentException:src/rule_with_actions.cc:127
ctunullpointer:src/rule_with_actions.cc:241
ctunullpointer:src/rule_with_operator.cc:135
ctunullpointer:src/rule_with_operator.cc:95
passedByValue:src/variables/global.h:109
@ -93,6 +93,10 @@ functionStatic
variableScope
shadowFunction
constVariable
stlcstrConstructor
stlcstrStream
uselessCallsSubstr
// Examples
memleak:examples/reading_logs_via_rule_message/reading_logs_via_rule_message.h:147