Files
codeql/cpp/ql/src/Critical/UseAfterFree.cpp
2018-09-23 16:23:52 -07:00

10 lines
180 B
C++

int f() {
char* buf = new char[SIZE];
....
if (error) {
free(buf); //error handling has freed the buffer
}
...
log_contents(buf); //but it is still used here for logging
}