Skip to content

Commit a29b958

Browse files
committed
C++: Address review comments
1 parent a5a6445 commit a29b958

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

cpp/ql/test/experimental/query-tests/Best Practices/GuardedFree/GuardedFree.expected

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
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 |

cpp/ql/test/experimental/query-tests/Best Practices/GuardedFree/test.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,21 +95,21 @@ void test11(char *x) {
9595
}
9696

9797
bool 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

105105
void test13(char *x) {
106-
if(x != nullptr) // BAD
106+
if (x != nullptr) // BAD
107107
free(x);
108108
}
109109

110110
void inspect(char *x);
111111

112112
void 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
}

0 commit comments

Comments
 (0)