From: Wilfried Goesgens Date: Fri, 26 Nov 2010 13:44:31 +0000 (+0100) Subject: Don't leak FD's while serving static files if they're not there X-Git-Tag: v8.01~561 X-Git-Url: https://code.citadel.org/?a=commitdiff_plain;h=07faae7c25ea8ed9c1ff3f5dd77eb7213a272ad0;p=citadel.git Don't leak FD's while serving static files if they're not there Ok, this case is rather theoretic, but if for some reason files disappear after webcits start initialising, we might hit this point. --- diff --git a/webcit/static.c b/webcit/static.c index 11b868ad5..145014bc9 100644 --- a/webcit/static.c +++ b/webcit/static.c @@ -60,6 +60,7 @@ void output_static(const char *what) begin_burst(); wc_printf("Cannot fstat %s: %s\n", what, strerror(errno)); end_burst(); + if (fd > 0) close(fd); return; }