hare

[hare] The Hare programming language
git clone https://git.torresjrjr.com/hare.git
Log | Files | Refs | README | LICENSE

commit 805b5df0492515aae3d2d2ef685edde403e27f75
parent d59562691351c10ecf7edc41041429cd53251bca
Author: Stacy Harper <contact@stacyharper.net>
Date:   Wed,  4 Jan 2023 20:55:35 +0100

Fix memory leak on os::diropen

os::diropen alloc the ofs but os::fs_close never free it.
Signed-off-by: Stacy Harper <contact@stacyharper.net>

Diffstat:
Mos/+linux/dirfdfs.ha | 1+
1 file changed, 1 insertion(+), 0 deletions(-)

diff --git a/os/+linux/dirfdfs.ha b/os/+linux/dirfdfs.ha @@ -374,6 +374,7 @@ fn fs_symlink(fs: *fs::fs, target: str, path: str) (void | fs::error) = { fn fs_close(fs: *fs::fs) void = { let fs = fs: *os_filesystem; rt::close(fs.dirfd)!; + free(fs); }; // Based on musl's readdir