From 30bfdad4589250bc86ffcaee24686fe6e9049838 Mon Sep 17 00:00:00 2001 From: M Hightower <27247790+mhightower83@users.noreply.github.com> Date: Fri, 20 Dec 2019 15:45:16 -0800 Subject: [PATCH] Added missing "if (umm_heap == NULL) {..." to umm_free_heap_size_lw (#6929) also called through xPortGetFreeHeapSize, umm_free_heap_size, ... Co-authored-by: Earle F. Philhower, III --- cores/esp8266/umm_malloc/umm_local.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cores/esp8266/umm_malloc/umm_local.c b/cores/esp8266/umm_malloc/umm_local.c index b984e86b8..1b20bcf7d 100644 --- a/cores/esp8266/umm_malloc/umm_local.c +++ b/cores/esp8266/umm_malloc/umm_local.c @@ -162,6 +162,10 @@ UMM_STATISTICS ummStats; // Keep complete call path in IRAM size_t umm_free_heap_size_lw( void ) { + if (umm_heap == NULL) { + umm_init(); + } + return (size_t)ummStats.free_blocks * sizeof(umm_block); } #endif @@ -211,5 +215,3 @@ int ICACHE_FLASH_ATTR umm_info_safe_printf_P(const char *fmt, ...) { } #endif // BUILD_UMM_MALLOC_C - -