Skip to content

Commit 9688451

Browse files
yongjianchndenji
authored andcommitted
bugfix: segfault while reloading
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
1 parent c759818 commit 9688451

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

ngx_http_upstream_check_module.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4060,5 +4060,12 @@ ngx_http_upstream_check_init_shm_peer(ngx_http_upstream_check_peer_shm_t *psh,
40604060
static ngx_int_t
40614061
ngx_http_upstream_check_init_process(ngx_cycle_t *cycle)
40624062
{
4063+
ngx_http_upstream_check_main_conf_t *ucmcf;
4064+
4065+
ucmcf = ngx_http_cycle_get_module_main_conf(cycle, ngx_http_upstream_check_module);
4066+
if (ucmcf == NULL) {
4067+
return NGX_OK;
4068+
}
4069+
40634070
return ngx_http_upstream_check_add_timers(cycle);
40644071
}

0 commit comments

Comments
 (0)