mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-09-29 19:24:29 +03:00
Flip allocations that happen during initialization (typically) over to use non-global apr memory pools.
This commit is contained in:
committed by
Felipe Zimmerle
parent
31d7fc6d38
commit
27dd513ab6
@@ -873,7 +873,7 @@ static const char *add_rule(cmd_parms *cmd, directory_config *dcfg, int type,
|
||||
*
|
||||
* ENH Probably do not want this done fully for chained rules.
|
||||
*/
|
||||
rule->actionset = msre_actionset_merge(modsecurity->msre, dcfg->tmp_default_actionset,
|
||||
rule->actionset = msre_actionset_merge(modsecurity->msre, cmd->pool, dcfg->tmp_default_actionset,
|
||||
rule->actionset, 1);
|
||||
|
||||
/* Keep track of the parent action for "block" */
|
||||
@@ -1068,7 +1068,7 @@ static const char *update_rule_action(cmd_parms *cmd, directory_config *dcfg,
|
||||
}
|
||||
|
||||
/* Create a new actionset */
|
||||
new_actionset = msre_actionset_create(modsecurity->msre, p2, &my_error_msg);
|
||||
new_actionset = msre_actionset_create(modsecurity->msre, cmd->pool, p2, &my_error_msg);
|
||||
if (new_actionset == NULL) return FATAL_ERROR;
|
||||
if (my_error_msg != NULL) return my_error_msg;
|
||||
|
||||
@@ -1095,7 +1095,7 @@ static const char *update_rule_action(cmd_parms *cmd, directory_config *dcfg,
|
||||
|
||||
/* Merge new actions with the rule */
|
||||
/* ENH: Will this leak the old actionset? */
|
||||
rule->actionset = msre_actionset_merge(modsecurity->msre, rule->actionset,
|
||||
rule->actionset = msre_actionset_merge(modsecurity->msre, cmd->pool, rule->actionset,
|
||||
new_actionset, 1);
|
||||
msre_actionset_set_defaults(rule->actionset);
|
||||
|
||||
@@ -1477,7 +1477,7 @@ static const char *cmd_default_action(cmd_parms *cmd, void *_dcfg,
|
||||
extern msc_engine *modsecurity;
|
||||
char *my_error_msg = NULL;
|
||||
|
||||
dcfg->tmp_default_actionset = msre_actionset_create(modsecurity->msre, p1, &my_error_msg);
|
||||
dcfg->tmp_default_actionset = msre_actionset_create(modsecurity->msre, cmd->pool, p1, &my_error_msg);
|
||||
if (dcfg->tmp_default_actionset == NULL) {
|
||||
if (my_error_msg != NULL) return my_error_msg;
|
||||
else return FATAL_ERROR;
|
||||
|
Reference in New Issue
Block a user