We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 00c7042 + 0c0720a commit 48048d6Copy full SHA for 48048d6
1 file changed
cpp/ql/src/Critical/UseAfterFree.cpp
@@ -1,9 +1,10 @@
1
-int f() {
+void f() {
2
char* buf = new char[SIZE];
3
- ....
+ ...
4
if (error) {
5
- free(buf); //error handling has freed the buffer
+ delete buf; //error handling has freed the buffer
6
}
7
...
8
log_contents(buf); //but it is still used here for logging
9
10
0 commit comments