mirror of
https://github.com/github/codeql.git
synced 2026-05-04 05:05:12 +02:00
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:
@@ -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]
|
||||
}
|
||||
Reference in New Issue
Block a user