From 2f2a496d48afafeffa243f211049608955a7b2c3 Mon Sep 17 00:00:00 2001 From: cinnaboot Date: Tue, 28 Dec 2021 11:19:23 -0500 Subject: [PATCH] replace assertion with conditional in utilSafeFree() --- src/util.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/util.h b/src/util.h index 60087f1..1044f7f 100644 --- a/src/util.h +++ b/src/util.h @@ -148,8 +148,10 @@ utilAllocateCStr(const char* str, u32 max_len) void utilSafeFree(void* p) { - assert(p != nullptr); - free(p); + if (p) + free(p); + else + printf("%s(), free called on nullptr\n", __FUNCTION__); } #endif