Mercurial > hg > nginx
comparison src/http/ngx_http.c @ 7671:7e0719fb528b
Fixed potential leak of temp pool.
In case ngx_hash_add_key() fails, need to goto failed instead of returning,
so that temp_pool will be destoryed.
author | Eran Kornblau <erankor@gmail.com> |
---|---|
date | Mon, 15 Jun 2020 03:58:31 -0400 |
parents | 4f9b72a229c1 |
children | 4e141d0816d4 001ec7fce567 |
comparison
equal
deleted
inserted
replaced
7670:ccb5ff87ab3e | 7671:7e0719fb528b |
---|---|
1467 | 1467 |
1468 rc = ngx_hash_add_key(&ha, &name[n].name, name[n].server, | 1468 rc = ngx_hash_add_key(&ha, &name[n].name, name[n].server, |
1469 NGX_HASH_WILDCARD_KEY); | 1469 NGX_HASH_WILDCARD_KEY); |
1470 | 1470 |
1471 if (rc == NGX_ERROR) { | 1471 if (rc == NGX_ERROR) { |
1472 return NGX_ERROR; | 1472 goto failed; |
1473 } | 1473 } |
1474 | 1474 |
1475 if (rc == NGX_DECLINED) { | 1475 if (rc == NGX_DECLINED) { |
1476 ngx_log_error(NGX_LOG_EMERG, cf->log, 0, | 1476 ngx_log_error(NGX_LOG_EMERG, cf->log, 0, |
1477 "invalid server name or wildcard \"%V\" on %V", | 1477 "invalid server name or wildcard \"%V\" on %V", |
1478 &name[n].name, &addr->opt.addr_text); | 1478 &name[n].name, &addr->opt.addr_text); |
1479 return NGX_ERROR; | 1479 goto failed; |
1480 } | 1480 } |
1481 | 1481 |
1482 if (rc == NGX_BUSY) { | 1482 if (rc == NGX_BUSY) { |
1483 ngx_log_error(NGX_LOG_WARN, cf->log, 0, | 1483 ngx_log_error(NGX_LOG_WARN, cf->log, 0, |
1484 "conflicting server name \"%V\" on %V, ignored", | 1484 "conflicting server name \"%V\" on %V, ignored", |