Resolver: fixed allocation error handling while resolving SRV.

This commit is contained in:
Bart Warmerdam 2017-06-19 14:25:42 +03:00
parent e6ac1b7f6b
commit 4f3956f62d
1 changed files with 3 additions and 1 deletions

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;