summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorJoerg Jung <jung@cvs.openbsd.org>2015-06-09 08:50:53 +0000
committerJoerg Jung <jung@cvs.openbsd.org>2015-06-09 08:50:53 +0000
commit3fc67069e071f82f24e2893c3f9913e32fe0c3b5 (patch)
tree7e19ff0cade12640d74c25d415291a066b9741d6 /usr.sbin
parent7820ade9e47305fd9f05f0a84e400de1ed2d80a3 (diff)
plug fd leak found by Todd Mortimer
ok claudio deraadt florian
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/httpd/server_fcgi.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/usr.sbin/httpd/server_fcgi.c b/usr.sbin/httpd/server_fcgi.c
index d0a8800cb07..c91c98b0e02 100644
--- a/usr.sbin/httpd/server_fcgi.c
+++ b/usr.sbin/httpd/server_fcgi.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: server_fcgi.c,v 1.53 2015/03/26 09:01:51 florian Exp $ */
+/* $OpenBSD: server_fcgi.c,v 1.54 2015/06/09 08:50:52 jung Exp $ */
/*
* Copyright (c) 2014 Florian Obser <florian@openbsd.org>
@@ -32,6 +32,7 @@
#include <time.h>
#include <ctype.h>
#include <event.h>
+#include <unistd.h>
#include "httpd.h"
#include "http.h"
@@ -153,7 +154,9 @@ server_fcgi(struct httpd *env, struct client *clt)
goto fail;
}
+ close(clt->clt_fd);
clt->clt_fd = fd;
+
if (clt->clt_srvbev != NULL)
bufferevent_free(clt->clt_srvbev);