Resolver: fixed allocation error handling while resolving SRV.

This commit is contained in:
Bart Warmerdam 2017-06-19 14:25:42 +03:00
parent 6a4a1f0e23
commit b0b24e8a30

View File

@ -443,7 +443,7 @@ ngx_resolve_name(ngx_resolver_ctx_t *ctx)
name.data = ngx_resolver_alloc(r, name.len);
if (name.data == NULL) {
return NGX_ERROR;
goto failed;
}
if (slen == ctx->service.len) {
@ -481,6 +481,8 @@ ngx_resolve_name(ngx_resolver_ctx_t *ctx)
ngx_resolver_free(r, ctx->event);
}
failed:
ngx_resolver_free(r, ctx);
return NGX_ERROR;