Commit: ae6b1615a8dfc4dc51e5dac04bba57be2d53bad5 Parent: 9aa421f633daa234458ad5f905bc89927f49edda Author: Randy Palamar Date: Sat, 22 Jun 2024 20:41:00 -0600 os_read_file: close fd after reading Diffstat:
M | os_unix.c | | | 1 | + |
1 file changed, 1 insertion(+), 0 deletions(-)
diff --git a/os_unix.c b/os_unix.c @@ -53,6 +53,7 @@ os_read_file(Arena *a, char *name, size filesize) s8 text = s8alloc(a, filesize); size rlen = read(fd, text.data, text.len); + close(fd); if (text.len != rlen) return (s8){0};