fix memory leak

This commit is contained in:
CiD-
2022-03-15 11:47:35 -04:00
parent 6d6e840bc2
commit 36c22393a4
2 changed files with 16 additions and 1 deletions
+2 -1
View File
@@ -112,7 +112,8 @@ _remove_all :: proc(path: string) -> Error {
loop: for {
res := unix.sys_getdents64(int(dfd), &buf[0], n)
switch res {
case -22: //-EINVAL
case -EINVAL:
delete(buf)
n *= 2
buf = make([]u8, n)
continue loop