[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
personal/stbuehler/fix-fdevent
Glenn Strauss 2018-06-30 21:43:19 -04:00
parent f4f13745c8
commit eb429c9c19
1 changed files with 6 additions and 1 deletions

View File

@ -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;