mirror of
https://github.com/nginx/nginx.git
synced 2024-12-18 07:37:49 +08:00
Resolver: fixed possible resource leak introduced in 5a16d40c63de.
Found by Coverity (CID 1351175).
This commit is contained in:
parent
aa8fa81e42
commit
625481f6f1
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user