From 42ad70591ab463fffe419ce07f3bd2a7995a54f1 Mon Sep 17 00:00:00 2001 From: Chris Conlon Date: Tue, 28 Jan 2014 10:28:19 -0700 Subject: [PATCH] prevent XFREE from freeing NULL pointer under Freescale MQX --- cyassl/ctaocrypt/settings.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cyassl/ctaocrypt/settings.h b/cyassl/ctaocrypt/settings.h index 0ca3f350e..22dea06d0 100644 --- a/cyassl/ctaocrypt/settings.h +++ b/cyassl/ctaocrypt/settings.h @@ -332,8 +332,8 @@ #include "mutex.h" #endif - #define XMALLOC(s, h, type) (void *)_mem_alloc_system((s)) - #define XFREE(p, h, type) _mem_free(p) + #define XMALLOC(s, h, t) (void *)_mem_alloc_system((s)) + #define XFREE(p, h, t) {void* xp = (p); if ((xp)) _mem_free((xp));} /* Note: MQX has no realloc, using fastmath above */ #endif