From e10105a780d98c31faf4f2bce60a2a9dfabec7ab Mon Sep 17 00:00:00 2001 From: gingerBill Date: Sun, 15 May 2022 23:50:51 +0100 Subject: [PATCH] Correct logic for tracking allocator proc for freeing a nil pointer --- core/mem/allocators.odin | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/mem/allocators.odin b/core/mem/allocators.odin index 235391bcd..d006e4574 100644 --- a/core/mem/allocators.odin +++ b/core/mem/allocators.odin @@ -858,7 +858,7 @@ tracking_allocator_proc :: proc(allocator_data: rawptr, mode: Allocator_Mode, result: []byte err: Allocator_Error - if mode == .Free && old_memory not_in data.allocation_map { + if mode == .Free && old_memory != nil && old_memory not_in data.allocation_map { append(&data.bad_free_array, Tracking_Allocator_Bad_Free_Entry{ memory = old_memory, location = loc,