From 9fc5afd5fde9afd87cbce0b1508f1ab685234350 Mon Sep 17 00:00:00 2001 From: david gauchard Date: Thu, 4 Mar 2021 22:27:42 +0100 Subject: [PATCH] OOM: avoid warn when calling *alloc(0) (#7909) --- cores/esp8266/heap.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cores/esp8266/heap.cpp b/cores/esp8266/heap.cpp index 4821f9b77..b3fde2f6c 100644 --- a/cores/esp8266/heap.cpp +++ b/cores/esp8266/heap.cpp @@ -194,8 +194,8 @@ void ICACHE_RAM_ATTR print_oom_size(size_t size) } } -#define OOM_CHECK__PRINT_OOM(p, s) if (!p) print_oom_size(s) -#define OOM_CHECK__PRINT_LOC(p, s, f, l) if (!p) print_loc(s, f, l) +#define OOM_CHECK__PRINT_OOM(p, s) if ((s) && !(p)) print_oom_size(s) +#define OOM_CHECK__PRINT_LOC(p, s, f, l) if ((s) && !(p)) print_loc(s, f, l) #else // ! DEBUG_ESP_OOM