mirror of
https://github.com/github/codeql.git
synced 2026-01-18 00:44:45 +01:00
* Remove the mismatch between `new` and `free` and use `delete` instead * Make the function `void`, so people copying the code will not forget to add a `return`. * Balance out the `...` for omitted code.
11 lines
186 B
C++
11 lines
186 B
C++
void f() {
|
|
char* buf = new char[SIZE];
|
|
...
|
|
if (error) {
|
|
delete buf; //error handling has freed the buffer
|
|
}
|
|
...
|
|
log_contents(buf); //but it is still used here for logging
|
|
...
|
|
}
|