summaryrefslogtreecommitdiff
path: root/src/mod_cgi.c
diff options
context:
space:
mode:
authorGlenn Strauss <gstrauss@gluelogic.com>2021-11-04 05:03:08 -0400
committerGlenn Strauss <gstrauss@gluelogic.com>2021-11-04 05:03:08 -0400
commitec50657efe9d9cb931b75f16d5d5130a85cd3869 (patch)
tree254790434a80873b50d7cb76fcfda369292476f5 /src/mod_cgi.c
parent8b10f94c07eb2a24a2ff8871ed2c1d38091c0682 (diff)
downloadlighttpd-git-ec50657efe9d9cb931b75f16d5d5130a85cd3869.tar.gz
[mod_cgi] check fd-to-cgi not -1 before close
sanity check
Diffstat (limited to 'src/mod_cgi.c')
-rw-r--r--src/mod_cgi.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/mod_cgi.c b/src/mod_cgi.c
index d956fa08..f1220038 100644
--- a/src/mod_cgi.c
+++ b/src/mod_cgi.c
@@ -415,6 +415,7 @@ static void cgi_pid_del(plugin_data *p, cgi_pid_t *cgi_pid) {
static void cgi_connection_close_fdtocgi(handler_ctx *hctx) {
/*(closes only hctx->fdtocgi)*/
+ if (-1 == hctx->fdtocgi) return;
struct fdevents * const ev = hctx->ev;
fdevent_fdnode_event_del(ev, hctx->fdntocgi);
/*fdevent_unregister(ev, hctx->fdtocgi);*//*(handled below)*/