From: Hoyoung Lee Date: Tue, 22 Jul 2025 17:41:01 +0000 (+0000) Subject: t/helper/test-truncate: close file descriptor after truncation X-Git-Tag: v2.51.0-rc0~17^2~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8cc19250b324c90f4283bcad488c8bbc756145c4;p=thirdparty%2Fgit.git t/helper/test-truncate: close file descriptor after truncation Fix a resource leak where the file descriptor was not closed after truncating a file in t/helper/test-truncate.c. Signed-off-by: Hoyoung Lee Signed-off-by: Junio C Hamano --- diff --git a/t/helper/test-truncate.c b/t/helper/test-truncate.c index 3931deaec7..2820cc7ed7 100644 --- a/t/helper/test-truncate.c +++ b/t/helper/test-truncate.c @@ -21,5 +21,8 @@ int cmd__truncate(int argc, const char **argv) if (ftruncate(fd, (off_t) sz) < 0) die_errno("failed to truncate file"); + + close(fd); + return 0; }