Resolver: fixed possible resource leak introduced in 5a16d40c63de.

Found by Coverity (CID 1351175).
This commit is contained in:
Ruslan Ermilov 2016-02-02 11:35:19 +03:00
parent aa8fa81e42
commit 625481f6f1

View File

@ -1215,6 +1215,7 @@ ngx_resolver_send_tcp_query(ngx_resolver_t *r, ngx_resolver_connection_t *rec,
b->start = ngx_resolver_alloc(r, NGX_RESOLVER_TCP_RSIZE);
if (b->start == NULL) {
ngx_resolver_free(r, b);
return NGX_ERROR;
}
@ -1236,6 +1237,7 @@ ngx_resolver_send_tcp_query(ngx_resolver_t *r, ngx_resolver_connection_t *rec,
b->start = ngx_resolver_alloc(r, NGX_RESOLVER_TCP_WSIZE);
if (b->start == NULL) {
ngx_resolver_free(r, b);
return NGX_ERROR;
}