diff options
| author | gingerBill <bill@gingerbill.org> | 2022-05-15 23:50:51 +0100 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2022-05-15 23:50:51 +0100 |
| commit | e10105a780d98c31faf4f2bce60a2a9dfabec7ab (patch) | |
| tree | be593d8d43e74b36ebe49ef1a63923d636b61a3f | |
| parent | 5451c9672d16f7a1db26d6c47e9e44b970f1e2c8 (diff) | |
Correct logic for tracking allocator proc for freeing a nil pointer
| -rw-r--r-- | core/mem/allocators.odin | 2 |
1 files changed, 1 insertions, 1 deletions
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, |