From 6b24663dd9a3b1289fb0caaa3eab45cb6e0a80c5 Mon Sep 17 00:00:00 2001 From: aliaspider Date: Sun, 7 Jan 2018 03:45:41 +0100 Subject: [PATCH] (WIIU) add more NULL check to *_free functions. --- wiiu/system/memory.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/wiiu/system/memory.c b/wiiu/system/memory.c index d3947b4f65..d0269411d1 100644 --- a/wiiu/system/memory.c +++ b/wiiu/system/memory.c @@ -134,7 +134,8 @@ void * MEM1_alloc(unsigned int size, unsigned int align) void MEM1_free(void *ptr) { - MEMFreeToExpHeap(mem1_heap, ptr); + if (ptr) + MEMFreeToExpHeap(mem1_heap, ptr); } void * MEMBucket_alloc(unsigned int size, unsigned int align) @@ -146,5 +147,6 @@ void * MEMBucket_alloc(unsigned int size, unsigned int align) void MEMBucket_free(void *ptr) { - MEMFreeToExpHeap(bucket_heap, ptr); + if (ptr) + MEMFreeToExpHeap(bucket_heap, ptr); }