From eb429c9c1981aaf8ab2014fe4dd230d27b2e8309 Mon Sep 17 00:00:00 2001 From: Glenn Strauss Date: Sat, 30 Jun 2018 21:43:19 -0400 Subject: [PATCH] [mod_fastcgi] fix memleak with FastCGI auth,resp (fixes #2894) fix memleak in mod_fastcgi when FastCGI is used for both authentication and response on the same request (thx rschmid) x-ref: "Memory leak if two fcgi calls with one request (authentication and response)" https://redmine.lighttpd.net/issues/2894 --- src/mod_fastcgi.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/mod_fastcgi.c b/src/mod_fastcgi.c index bec5d0d7..15c2032f 100644 --- a/src/mod_fastcgi.c +++ b/src/mod_fastcgi.c @@ -515,7 +515,12 @@ static handler_t fcgi_check_extension(server *srv, connection *con, void *p_d, i hctx->opts.pdata = hctx; hctx->stdin_append = fcgi_stdin_append; hctx->create_env = fcgi_create_env; - hctx->rb = chunkqueue_init(); + if (!hctx->rb) { + hctx->rb = chunkqueue_init(); + } + else { + chunkqueue_reset(hctx->rb); + } } return HANDLER_GO_ON;