summaryrefslogtreecommitdiffhomepage
path: root/src/http/modules
diff options
context:
space:
mode:
authorSergey Kandaurov <pluknet@nginx.com>2025-08-08 19:44:27 +0400
committerpluknet <pluknet@nginx.com>2025-08-11 20:57:47 +0400
commit034f15bbc251ed72018d8396e7eeb3bf30fd789b (patch)
treefe18c3309f31176f0deaa2d34e103c1414767db4 /src/http/modules
parent251444fcf4434bfddbe3394a568c51d4f7bd857f (diff)
downloadnginx-034f15bbc251ed72018d8396e7eeb3bf30fd789b.tar.gz
nginx-034f15bbc251ed72018d8396e7eeb3bf30fd789b.tar.bz2
Auth basic: fixed file descriptor leak on memory allocation error.
Found by Coverity (CID 1662016).
Diffstat (limited to 'src/http/modules')
-rw-r--r--src/http/modules/ngx_http_auth_basic_module.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/http/modules/ngx_http_auth_basic_module.c b/src/http/modules/ngx_http_auth_basic_module.c
index 02d41e88a..69e8d2161 100644
--- a/src/http/modules/ngx_http_auth_basic_module.c
+++ b/src/http/modules/ngx_http_auth_basic_module.c
@@ -253,7 +253,8 @@ ngx_http_auth_basic_handler(ngx_http_request_t *r)
pwd.len = i - passwd;
pwd.data = ngx_pnalloc(r->pool, pwd.len + 1);
if (pwd.data == NULL) {
- return NGX_HTTP_INTERNAL_SERVER_ERROR;
+ rc = NGX_HTTP_INTERNAL_SERVER_ERROR;
+ goto cleanup;
}
ngx_cpystrn(pwd.data, &buf[passwd], pwd.len + 1);