diff --git a/src/ngx_postgres_module.c b/src/ngx_postgres_module.c index 365de007..59ee6d11 100644 --- a/src/ngx_postgres_module.c +++ b/src/ngx_postgres_module.c @@ -284,6 +284,9 @@ ngx_postgres_create_upstream_srv_conf(ngx_conf_t *cf) conf->single = 1; cln = ngx_pool_cleanup_add(cf->pool, 0); + if (cln == NULL) { + return NULL; + } cln->handler = ngx_postgres_keepalive_cleanup; cln->data = conf;