Skip to content

Commit

Permalink
bugfix: segfault while reloading
Browse files Browse the repository at this point in the history
reproduce:
1. use normal config with http{} and check directives in http{upstream{}}
2. start nginx
3. delete the whole http{} in config file
4. reload

	modified:   ngx_http_upstream_check_module.c
  • Loading branch information
yongjianchn committed Nov 6, 2017
1 parent 31b1b42 commit 961e0b2
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions ngx_http_upstream_check_module.c
Original file line number Diff line number Diff line change
Expand Up @@ -4060,5 +4060,12 @@ ngx_http_upstream_check_init_shm_peer(ngx_http_upstream_check_peer_shm_t *psh,
static ngx_int_t
ngx_http_upstream_check_init_process(ngx_cycle_t *cycle)
{
ngx_http_upstream_check_main_conf_t *ucmcf;

ucmcf = ngx_http_cycle_get_module_main_conf(cycle, ngx_http_upstream_check_module);
if (ucmcf == NULL) {
return NGX_OK;
}

return ngx_http_upstream_check_add_timers(cycle);
}

0 comments on commit 961e0b2

Please sign in to comment.