os2: fix leak and always close directory

This commit is contained in:
Laytan Laats
2024-08-14 01:44:37 +02:00
parent f00f68ef6f
commit 939ba4cf08
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -76,7 +76,7 @@ concatenate :: proc(strings: []string, allocator: runtime.Allocator) -> (res: st
for s in strings {
n += len(s)
}
buf := make([]byte, n) or_return
buf := make([]byte, n, allocator) or_return
n = 0
for s in strings {
n += copy(buf[n:], s)