From 7a0b27b8024d66c02e08c357173b07bbf40fa88c Mon Sep 17 00:00:00 2001 From: jung Date: Tue, 9 Jun 2015 08:50:52 +0000 Subject: [PATCH] plug fd leak found by Todd Mortimer ok claudio deraadt florian --- usr.sbin/httpd/server_fcgi.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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 @@ -32,6 +32,7 @@ #include #include #include +#include #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); -- 2.20.1