diff --git a/src/core/memp.c b/src/core/memp.c index 515df2d6..799ed51b 100644 --- a/src/core/memp.c +++ b/src/core/memp.c @@ -339,13 +339,13 @@ do_memp_malloc_pool_fn(const struct memp_desc *desc, const char* file, const int /* cast through u8_t* to get rid of alignment warnings */ return ((u8_t*)memp + MEMP_SIZE); } else { - LWIP_DEBUGF(MEMP_DEBUG | LWIP_DBG_LEVEL_SERIOUS, ("memp_malloc: out of memory in pool %s\n", desc->desc)); #if MEMP_STATS desc->stats->err++; #endif + SYS_ARCH_UNPROTECT(old_level); + LWIP_DEBUGF(MEMP_DEBUG | LWIP_DBG_LEVEL_SERIOUS, ("memp_malloc: out of memory in pool %s\n", desc->desc)); } - SYS_ARCH_UNPROTECT(old_level); return NULL; }