[windows] Fix leak in glob.

This commit is contained in:
Jeroen van Rijn
2022-03-29 16:13:17 +02:00
parent 085fa199ea
commit df32b5b46c
7 changed files with 23 additions and 16 deletions
+1 -1
View File
@@ -122,6 +122,7 @@ clean :: proc(path: string, allocator := context.allocator) -> string {
vol_and_path = original_path,
vol_len = vol_len,
}
defer lazy_buffer_destroy(out)
r, dot_dot := 0, 0
if rooted {
@@ -170,7 +171,6 @@ clean :: proc(path: string, allocator := context.allocator) -> string {
cleaned, new_allocation := from_slash(s)
if new_allocation {
delete(s)
lazy_buffer_destroy(out)
}
return cleaned
}