quick resolving handles u->resolved->ctx by itself
diff --git a/src/http/ngx_http_upstream.c b/src/http/ngx_http_upstream.c
index 987742e..ed280a8 100644
--- a/src/http/ngx_http_upstream.c
+++ b/src/http/ngx_http_upstream.c
@@ -421,13 +421,14 @@
         ctx->data = r;
         ctx->timeout = clcf->resolver_timeout;
 
+        u->resolved->ctx = ctx;
+
         if (ngx_resolve_name(ctx) != NGX_OK) {
+            u->resolved->ctx = NULL;
             ngx_http_finalize_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR);
             return;
         }
 
-        u->resolved->ctx = ctx;
-
         return;
     }