From 7bee0b64ca0da917b44de6cc8c98151c608e7cd4 Mon Sep 17 00:00:00 2001 From: ligd Date: Fri, 25 Jul 2025 11:50:50 +0800 Subject: [PATCH] libc: fix assert "Free memory from the wrong heap" with flat mode and user separated heap enabled mode In flat mode: kernel code, like net driver... strdup -> nx_strdup -> kmm_malloc lib_free -> kmm_free app code, like stdlib... strdup -> malloc free -> free Signed-off-by: ligd --- include/nuttx/lib/lib.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/nuttx/lib/lib.h b/include/nuttx/lib/lib.h index 92c2436988a4d..c6d7e7ada8dc0 100644 --- a/include/nuttx/lib/lib.h +++ b/include/nuttx/lib/lib.h @@ -45,7 +45,7 @@ * then only the first mode is supported. */ -#if !defined(CONFIG_BUILD_FLAT) && defined(__KERNEL__) +#if defined(__KERNEL__) /* Domain-specific allocations */