mirror of
https://github.com/git/git.git
synced 2026-01-11 13:23:12 +09:00
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>
This commit is contained in:
parent
16bd9f20a4
commit
8cc19250b3
@ -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;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user