]> git.kaiwu.me - nginx.git/commit
Limit conn: fixed counter leak on memory allocation errors.
authorMaxim Dounin <mdounin@mdounin.ru>
Mon, 7 Jul 2025 01:34:18 +0000 (04:34 +0300)
committerRoman Arutyunyan <arutyunyan.roman@gmail.com>
Thu, 22 Oct 2026 11:59:04 +0000 (15:59 +0400)
commit807e53d990e80b3a279e80d261213be1e06cc635
treef3fcd02fa6f0f74d648e60b8019823380ddb779e
parent83f041908bc7fa1e3faabe6ed8497b8e27412e40
Limit conn: fixed counter leak on memory allocation errors.

Previously, if ngx_pool_cleanup_add() failed, already incremented
connection counter was left as is, eventually resulting in unexpected
connection limiting or shared memory exhaustion.  Fix is to decrement
the counter by calling the cleanup handler with data on stack.

Signed-off-by: Elijah Zupancic <e.zupancic@f5.com>
Origin: <https://freenginx.org/hg/nginx/rev/722e252fcabe6413eb63555890273d7b0e7fc132>
src/http/modules/ngx_http_limit_conn_module.c
src/stream/ngx_stream_limit_conn_module.c