Skip to content

Commit

Permalink
RB-17343: fix ngx.graphite without graphite_config segfault
Browse files Browse the repository at this point in the history
  • Loading branch information
Mikhail Kirichenko committed Nov 28, 2017
1 parent f52f71b commit 5a6d15b
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/ngx_http_graphite_module.c
Original file line number Diff line number Diff line change
Expand Up @@ -699,8 +699,12 @@ ngx_http_graphite_context_from_request(ngx_http_request_t *r) {

ngx_http_graphite_main_conf_t *gmcf = ngx_http_get_module_main_conf(r, ngx_http_graphite_module);

ngx_slab_pool_t *shpool = (ngx_slab_pool_t*)gmcf->shared->shm.addr;
ngx_http_graphite_storage_t *storage = (ngx_http_graphite_storage_t*)shpool->data;
ngx_http_graphite_storage_t *storage = NULL;

if (gmcf->enable) {
ngx_slab_pool_t *shpool = (ngx_slab_pool_t*)gmcf->shared->shm.addr;
storage = (ngx_http_graphite_storage_t*)shpool->data;
}

ngx_http_graphite_context_t context;
context.phase = PHASE_REQUEST;
Expand Down

0 comments on commit 5a6d15b

Please sign in to comment.