From d34a824133ac56d34d9806f9cb7ca6ff1d65c2e6 Mon Sep 17 00:00:00 2001 From: CPunch Date: Thu, 7 Apr 2022 23:21:09 -0500 Subject: [PATCH] Remove unneeded check --- lib/src/lmem.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/src/lmem.c b/lib/src/lmem.c index 9aa3130..fa6ce26 100644 --- a/lib/src/lmem.c +++ b/lib/src/lmem.c @@ -6,8 +6,7 @@ void *laikaM_realloc(void *buf, size_t sz) { /* are we free'ing the buffer? */ if (sz == 0) { - if (buf != NULL) /* sanity check :) */ - free(buf); + free(buf); return NULL; } @@ -16,4 +15,4 @@ void *laikaM_realloc(void *buf, size_t sz) { LAIKA_ERROR("failed to allocate memory!\n"); return newBuf; -} \ No newline at end of file +}