From: jsg Date: Thu, 18 Aug 2016 00:44:37 +0000 (+0000) Subject: fix an fd leak X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=fd3cdd868792f9d858a1b46606cd09519e5af8e6;p=openbsd fix an fd leak ok schwarze@ --- diff --git a/usr.bin/mandoc/cgi.c b/usr.bin/mandoc/cgi.c index 1fc545ecf99..2bb1f6a8981 100644 --- a/usr.bin/mandoc/cgi.c +++ b/usr.bin/mandoc/cgi.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cgi.c,v 1.76 2016/08/10 18:39:04 schwarze Exp $ */ +/* $OpenBSD: cgi.c,v 1.77 2016/08/18 00:44:37 jsg Exp $ */ /* * Copyright (c) 2011, 2012 Kristaps Dzonsons * Copyright (c) 2014, 2015, 2016 Ingo Schwarze @@ -336,6 +336,7 @@ resp_copy(const char *filename) fflush(stdout); while ((sz = read(fd, buf, sizeof(buf))) > 0) write(STDOUT_FILENO, buf, sz); + close(fd); } }