Avoid assertion violation in case of kmm_free(NULL)

It is ok to call kmm_free with a NULL pointer.  Thus adopt the
DEBUGASSERT statement to cover this case.

Signed-off-by: Michael Jung <michael.jung@secore.ly>
This commit is contained in:
Michael Jung
2022-08-26 11:07:08 +02:00
committed by Xiang Xiao
parent 2d32ebe952
commit 1ad066955f
+1 -1
View File
@@ -52,7 +52,7 @@
void kmm_free(FAR void *mem)
{
DEBUGASSERT(kmm_heapmember(mem));
DEBUGASSERT((mem == NULL) || kmm_heapmember(mem));
mm_free(g_kmmheap, mem);
}