diff options
| author | Hoyoung Lee <lhywkd22@gmail.com> | 2025-07-22 17:41:01 +0000 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2025-07-22 14:05:34 -0700 |
| commit | 8cc19250b324c90f4283bcad488c8bbc756145c4 (patch) | |
| tree | fb8dd0d83756a4f8238d7ded32da74aaf2483214 /t/helper/test-truncate.c | |
| parent | Git 2.50 (diff) | |
| download | git-8cc19250b324c90f4283bcad488c8bbc756145c4.tar.gz git-8cc19250b324c90f4283bcad488c8bbc756145c4.zip | |
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 <lhywkd22@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/helper/test-truncate.c')
| -rw-r--r-- | t/helper/test-truncate.c | 3 |
1 files changed, 3 insertions, 0 deletions
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; } |
