mirror of
https://github.com/github/codeql.git
synced 2026-04-25 16:55:19 +02:00
C++: Address review comments
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
| test.cpp:31:7:31:24 | ... \|\| ... | unnecessary NULL check before call to $@ | test.cpp:35:3:35:6 | call to free | free |
|
||||
| test.cpp:31:8:31:8 | x | unnecessary NULL check before call to $@ | test.cpp:35:3:35:6 | call to free | free |
|
||||
| test.cpp:94:12:94:12 | x | unnecessary NULL check before call to $@ | test.cpp:94:3:94:13 | call to free | free |
|
||||
| test.cpp:98:6:98:7 | ! ... | unnecessary NULL check before call to $@ | test.cpp:101:3:101:6 | call to free | free |
|
||||
| test.cpp:98:7:98:7 | x | unnecessary NULL check before call to $@ | test.cpp:101:3:101:6 | call to free | free |
|
||||
| test.cpp:106:6:106:17 | ... != ... | unnecessary NULL check before call to $@ | test.cpp:107:5:107:8 | call to free | free |
|
||||
| test.cpp:113:6:113:17 | ... != ... | unnecessary NULL check before call to $@ | test.cpp:114:17:114:20 | call to free | free |
|
||||
| test.cpp:98:7:98:8 | ! ... | unnecessary NULL check before call to $@ | test.cpp:101:3:101:6 | call to free | free |
|
||||
| test.cpp:98:8:98:8 | x | unnecessary NULL check before call to $@ | test.cpp:101:3:101:6 | call to free | free |
|
||||
| test.cpp:106:7:106:18 | ... != ... | unnecessary NULL check before call to $@ | test.cpp:107:5:107:8 | call to free | free |
|
||||
| test.cpp:113:7:113:18 | ... != ... | unnecessary NULL check before call to $@ | test.cpp:114:17:114:20 | call to free | free |
|
||||
|
||||
@@ -95,7 +95,7 @@ void test11(char *x) {
|
||||
}
|
||||
|
||||
bool test12(char *x) {
|
||||
if(!x) // GOOD [FALSE POSITIVE]: return value depends on x
|
||||
if (!x) // GOOD [FALSE POSITIVE]: return value depends on x
|
||||
return false;
|
||||
|
||||
free(x);
|
||||
@@ -103,13 +103,13 @@ bool test12(char *x) {
|
||||
}
|
||||
|
||||
void test13(char *x) {
|
||||
if(x != nullptr) // BAD
|
||||
if (x != nullptr) // BAD
|
||||
free(x);
|
||||
}
|
||||
|
||||
void inspect(char *x);
|
||||
|
||||
void test14(char *x) {
|
||||
if(x != nullptr) // GOOD [FALSE POSITIVE]: x might be accessed
|
||||
if (x != nullptr) // GOOD [FALSE POSITIVE]: x might be accessed
|
||||
inspect(x), free(x);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user