Преглед изворни кода

[core/os2]: Fix memory leak on read_entire_file

flysand7 пре 1 година
родитељ
комит
3ee9184537
1 измењених фајлова са 1 додато и 1 уклоњено
  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 {
 	} else {
 		buffer: [1024]u8
 		buffer: [1024]u8
-		out_buffer := make([dynamic]u8)
+		out_buffer := make([dynamic]u8, 0, 0, allocator)
 		total := 0
 		total := 0
 		for {
 		for {
 			n: int = ---
 			n: int = ---