Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/ngx_http_modsecurity_module.c
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ ngx_conf_set_rules(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)

if (res < 0) {
dd("Failed to load the rules: '%s' - reason: '%s'", rules, error);
return strdup(error);
return (char *) ngx_pstrdup(cf->pool, &(ngx_str_t){ngx_strlen(error), (u_char *)error});
}

mmcf = ngx_http_conf_get_module_main_conf(cf, ngx_http_modsecurity_module);
Expand Down Expand Up @@ -401,7 +401,7 @@ ngx_conf_set_rules_file(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)

if (res < 0) {
dd("Failed to load the rules from: '%s' - reason: '%s'", rules_set, error);
return strdup(error);
return (char *) ngx_pstrdup(cf->pool, &(ngx_str_t){ngx_strlen(error), (u_char *)error});
}

mmcf = ngx_http_conf_get_module_main_conf(cf, ngx_http_modsecurity_module);
Expand Down Expand Up @@ -440,7 +440,7 @@ ngx_conf_set_rules_remote(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)

if (res < 0) {
dd("Failed to load the rules from: '%s' - reason: '%s'", rules_remote_server, error);
return strdup(error);
return (char *) ngx_pstrdup(cf->pool, &(ngx_str_t){ngx_strlen(error), (u_char *)error});
}

mmcf = ngx_http_conf_get_module_main_conf(cf, ngx_http_modsecurity_module);
Expand Down Expand Up @@ -580,7 +580,7 @@ ngx_http_modsecurity_init(ngx_conf_t *cf)
}
/**
*
* We want to process everything in the NGX_HTTP_ACCESS_PHASE because we need to allow
* We want to process everything in the NGX_HTTP_ACCESS_PHASE because we need to allow
* ngx_http_limit_*_module to run
*
*/
Expand Down
Loading