shared-memory-locks: Fix a segmentation fault
Do not instantiate a ProxyFetchFactory when the ServerContext is NULL on cfg_s
This commit is contained in:
@@ -1646,8 +1646,13 @@ ngx_int_t ps_init_child_process(ngx_cycle_t* cycle) {
|
||||
for (s = 0; s < cmcf->servers.nelts; s++) {
|
||||
ps_srv_conf_t* cfg_s = static_cast<ps_srv_conf_t*>(
|
||||
cscfp[s]->ctx->srv_conf[ngx_pagespeed.ctx_index]);
|
||||
cfg_s->proxy_fetch_factory =
|
||||
new net_instaweb::ProxyFetchFactory(cfg_s->server_context);
|
||||
|
||||
// Some server{} blocks may not have a ServerContext in that case we must
|
||||
// not instantiate a ProxyFetchFactory.
|
||||
if (cfg_s->server_context != NULL) {
|
||||
cfg_s->proxy_fetch_factory =
|
||||
new net_instaweb::ProxyFetchFactory(cfg_s->server_context);
|
||||
}
|
||||
}
|
||||
|
||||
cfg_m->driver_factory->StartThreads();
|
||||
|
||||
Reference in New Issue
Block a user