提交 094c05e9 编写于 作者: B Bryon Gloden, CISSP® 提交者: GitHub

Update unity_fixture_Test.c

[../Unity-master/extras/fixture/test/unity_fixture_Test.c:530]: (error) Deallocating a deallocated pointer: n1

This solution from Daniel Fischer was helpful in fixing the error because if realloc returns a pointer to a different location, the old location is freed.

Found by https://github.com/bryongloden/cppcheck
上级 ad0c07c9
...@@ -527,7 +527,6 @@ TEST(InternalMalloc, ReallocFailDoesNotFreeMem) ...@@ -527,7 +527,6 @@ TEST(InternalMalloc, ReallocFailDoesNotFreeMem)
TEST_ASSERT_NULL(out_of_mem); TEST_ASSERT_NULL(out_of_mem);
TEST_ASSERT_NOT_EQUAL(n2, n1); TEST_ASSERT_NOT_EQUAL(n2, n1);
free(n2); free(n2);
free(n1);
free(m); free(m);
#endif #endif
} }
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册