Skip to content

Commit 02c0501

Browse files
committed
rt: memory_region::free(NULL) shouldn't touch the live allocation count
1 parent 4673eb6 commit 02c0501

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/rt/memory_region.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ memory_region::memory_region(memory_region *parent) :
2121

2222
void memory_region::free(void *mem) {
2323
// printf("free: ptr 0x%" PRIxPTR"\n", (uintptr_t) mem);
24+
if (!mem) { return; }
2425
if (_synchronized) { _lock.lock(); }
2526
#ifdef TRACK_ALLOCATIONS
2627
if (_allocation_list.replace(mem, NULL) == false) {

0 commit comments

Comments
 (0)