Skip to content

Commit 9ad6c53

Browse files
author
Зишан Мирза
committed
add close function
1 parent 63a9e41 commit 9ad6c53

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

libc/src/time/timezone.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,13 @@ int get_timezone_offset(char *timezone) {
5959

6060
fd = open("/etc/localtime", O_RDONLY);
6161
if (fd < 0) {
62+
close(fd);
6263
return 0;
6364
}
6465

6566
bytes = read(fd, hdr, sizeof(hdr));
6667
if (bytes != sizeof(hdr)) {
68+
close(fd);
6769
return 0;
6870
}
6971

0 commit comments

Comments
 (0)