Skip to content

Commit 683adce

Browse files
committed
The pool pointer is now available for ngx_http_modsecurity_config_cleanup
1 parent a2a5858 commit 683adce

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/ngx_http_modsecurity_common.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@ typedef struct {
6262
ngx_flag_t sanity_checks_enabled;
6363

6464
Rules *rules_set;
65+
66+
void *pool;
6567
} ngx_http_modsecurity_conf_t;
6668

6769

src/ngx_http_modsecurity_module.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -545,6 +545,7 @@ static void *ngx_http_modsecurity_create_conf(ngx_conf_t *cf)
545545
conf->enable = NGX_CONF_UNSET;
546546
conf->sanity_checks_enabled = NGX_CONF_UNSET;
547547
conf->rules_set = msc_create_rules_set();
548+
conf->pool = cf->pool;
548549

549550
cln = ngx_pool_cleanup_add(cf->pool, 0);
550551
if (cln == NULL) {
@@ -649,7 +650,7 @@ ngx_http_modsecurity_config_cleanup(void *data)
649650

650651
dd("deleting a loc conf -- RuleSet is: \"%p\"", t->rules_set);
651652

652-
old_pool = ngx_http_modsecurity_pcre_malloc_init(NULL);
653+
old_pool = ngx_http_modsecurity_pcre_malloc_init(t->pool);
653654
msc_rules_cleanup(t->rules_set);
654655
ngx_http_modsecurity_pcre_malloc_done(old_pool);
655656

0 commit comments

Comments
 (0)