From: florian Date: Mon, 29 Apr 2024 16:17:46 +0000 (+0000) Subject: plug fd leak introduced in "avoid toctu" rewrite. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=d842f11e1d9610068997e5d5fef3d53c151a38a3;p=openbsd plug fd leak introduced in "avoid toctu" rewrite. Issue reported by job OK tb, job --- diff --git a/usr.sbin/httpd/server_file.c b/usr.sbin/httpd/server_file.c index 851ad462b02..cdcc11cd800 100644 --- a/usr.sbin/httpd/server_file.c +++ b/usr.sbin/httpd/server_file.c @@ -1,4 +1,4 @@ -/* $OpenBSD: server_file.c,v 1.79 2024/04/16 17:15:50 florian Exp $ */ +/* $OpenBSD: server_file.c,v 1.80 2024/04/29 16:17:46 florian Exp $ */ /* * Copyright (c) 2006 - 2017 Reyk Floeter @@ -287,6 +287,7 @@ server_file_request(struct httpd *env, struct client *clt, struct media_type if ((ret = server_response_http(clt, ret, media, -1, MINIMUM(time(NULL), st->st_mtim.tv_sec))) == -1) goto fail; + close(fd); goto done; }