]> git.kaiwu.me - nginx.git/commitdiff
ngx_resolve_name() frees ctx on immediate failure
authorIgor Sysoev <igor@sysoev.ru>
Wed, 5 Mar 2008 07:30:44 +0000 (07:30 +0000)
committerIgor Sysoev <igor@sysoev.ru>
Wed, 5 Mar 2008 07:30:44 +0000 (07:30 +0000)
src/http/ngx_http_upstream.c

index 2412779027c9bbd7c0daa002a6cb0dcba2c4d92a..7041514c8c6fd4490901d0c7c853ff6f5ac5e598 100644 (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;
     }