diff --git a/extras/fixture/test/unity_fixture_Test.c b/extras/fixture/test/unity_fixture_Test.c index 8f3b885..0729e1f 100644 --- a/extras/fixture/test/unity_fixture_Test.c +++ b/extras/fixture/test/unity_fixture_Test.c @@ -524,7 +524,11 @@ TEST(InternalMalloc, ReallocFailDoesNotFreeMem) void* out_of_mem = realloc(n1, UNITY_INTERNAL_HEAP_SIZE_BYTES/2 + 1); void* n2 = malloc(10); TEST_ASSERT_NOT_NULL(m); - TEST_ASSERT_NULL(out_of_mem); + if (out_of_mem == NULL) + { + free(n1); + TEST_ASSERT_NULL(out_of_mem); + } TEST_ASSERT_NOT_EQUAL(n2, n1); free(n2); free(m);