ngx_resolve_name() frees ctx on immediate failure

This commit is contained in:
Igor Sysoev 2008-03-05 07:30:44 +00:00
parent 887dd4e5d5
commit cca6000247

View File

@ -422,13 +422,13 @@ ngx_http_upstream_init(ngx_http_request_t *r)
ctx->data = r;
ctx->timeout = clcf->resolver_timeout;
u->resolved->ctx = ctx;
if (ngx_resolve_name(ctx) != NGX_OK) {
ngx_http_finalize_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR);
return;
}
u->resolved->ctx = ctx;
return;
}