multi_heap: ensure that malloc(0) return NULL pointer in any poisoning configuration

This commit is contained in:
Felipe Neves
2020-03-17 15:58:25 -03:00
committed by bot
parent 6330b3345e
commit 481379f14d
3 changed files with 24 additions and 1 deletions

View File

@@ -127,3 +127,10 @@ TEST_CASE("unreasonable allocs should all fail", "[heap]")
TEST_ASSERT_NULL(test_malloc_wrapper(xPortGetFreeHeapSize() - 1));
}
TEST_CASE("malloc(0) should return a NULL pointer", "[heap]")
{
void *p;
p = malloc(0);
TEST_ASSERT(p == NULL);
}