From d842f11e1d9610068997e5d5fef3d53c151a38a3 Mon Sep 17 00:00:00 2001 From: florian Date: Mon, 29 Apr 2024 16:17:46 +0000 Subject: [PATCH] plug fd leak introduced in "avoid toctu" rewrite. Issue reported by job OK tb, job --- usr.sbin/httpd/server_file.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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; } -- 2.20.1