File tree Expand file tree Collapse file tree 2 files changed +7
-7
lines changed
cpp/ql/test/experimental/query-tests/Best Practices/GuardedFree Expand file tree Collapse file tree 2 files changed +7
-7
lines changed Original file line number Diff line number Diff line change 44| test.cpp:31:7:31:24 | ... \|\| ... | unnecessary NULL check before call to $@ | test.cpp:35:3:35:6 | call to free | free |
55| test.cpp:31:8:31:8 | x | unnecessary NULL check before call to $@ | test.cpp:35:3:35:6 | call to free | free |
66| test.cpp:94:12:94:12 | x | unnecessary NULL check before call to $@ | test.cpp:94:3:94:13 | call to free | free |
7- | test.cpp:98:6 :98:7 | ! ... | unnecessary NULL check before call to $@ | test.cpp:101:3:101:6 | call to free | free |
8- | test.cpp:98:7 :98:7 | x | unnecessary NULL check before call to $@ | test.cpp:101:3:101:6 | call to free | free |
9- | test.cpp:106:6 :106:17 | ... != ... | unnecessary NULL check before call to $@ | test.cpp:107:5:107:8 | call to free | free |
10- | test.cpp:113:6 :113:17 | ... != ... | unnecessary NULL check before call to $@ | test.cpp:114:17:114:20 | call to free | free |
7+ | test.cpp:98:7 :98:8 | ! ... | unnecessary NULL check before call to $@ | test.cpp:101:3:101:6 | call to free | free |
8+ | test.cpp:98:8 :98:8 | x | unnecessary NULL check before call to $@ | test.cpp:101:3:101:6 | call to free | free |
9+ | test.cpp:106:7 :106:18 | ... != ... | unnecessary NULL check before call to $@ | test.cpp:107:5:107:8 | call to free | free |
10+ | test.cpp:113:7 :113:18 | ... != ... | unnecessary NULL check before call to $@ | test.cpp:114:17:114:20 | call to free | free |
Original file line number Diff line number Diff line change @@ -95,21 +95,21 @@ void test11(char *x) {
9595}
9696
9797bool test12 (char *x) {
98- if (!x) // GOOD [FALSE POSITIVE]: return value depends on x
98+ if (!x) // GOOD [FALSE POSITIVE]: return value depends on x
9999 return false ;
100100
101101 free (x);
102102 return true ;
103103}
104104
105105void test13 (char *x) {
106- if (x != nullptr ) // BAD
106+ if (x != nullptr ) // BAD
107107 free (x);
108108}
109109
110110void inspect (char *x);
111111
112112void test14 (char *x) {
113- if (x != nullptr ) // GOOD [FALSE POSITIVE]: x might be accessed
113+ if (x != nullptr ) // GOOD [FALSE POSITIVE]: x might be accessed
114114 inspect (x), free (x);
115115}
You can’t perform that action at this time.
0 commit comments