Browse Source

[core/os2]: Fix memory leak on read_entire_file

flysand7 1 year ago
parent
commit
3ee9184537
1 changed files with 1 additions and 1 deletions
  1. 1 1
      core/os/os2/file_util.odin

+ 1 - 1
core/os/os2/file_util.odin

@@ -117,7 +117,7 @@ read_entire_file_from_file :: proc(f: ^File, allocator: runtime.Allocator) -> (d
 		}
 	} else {
 		buffer: [1024]u8
-		out_buffer := make([dynamic]u8)
+		out_buffer := make([dynamic]u8, 0, 0, allocator)
 		total := 0
 		for {
 			n: int = ---