1
0
mirror of https://github.com/ThrowTheSwitch/Unity.git synced 2026-01-27 10:14:28 +01:00

unity_fixture: Make unity_free() NULL-safe

At the start of unity_free(), check mem for NULL, and return immediately
if it is, so we don't crash in this case. This mimics the behaviour of
most free() implementations. Closes #135.

Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
This commit is contained in:
Gergely Nagy
2015-10-06 10:44:44 +02:00
parent 7f9f937cd1
commit 1affe544d2
3 changed files with 14 additions and 1 deletions

View File

@@ -132,6 +132,11 @@ TEST(UnityFixture, PointerSet)
TEST_ASSERT_POINTERS_EQUAL(&c2, p2);
}
TEST(UnityFixture, FreeNULLSafety)
{
unity_free(NULL);
}
//------------------------------------------------------------
TEST_GROUP(UnityCommandOptions);