C++: Add another FP test. We already have tests for this, but it doesn't hurt to have another one, I guess.

This commit is contained in:
Mathias Vorreiter Pedersen
2024-06-13 10:57:49 +01:00
parent a756f86847
commit eec259279a
3 changed files with 25 additions and 0 deletions

View File

@@ -345,3 +345,14 @@ void test_array(PtrContainer *containers) {
delete containers[2].ptr; // GOOD [FALSE POSITIVE]
delete containers[2].ptr; // BAD (double free)
}
struct E {
struct EC {
int* a;
} ec[2];
};
void test(E* e) {
free(e->ec[0].a);
free(e->ec[1].a); // GOOD [FALSE POSITIVE]
}