Files
codeql/cpp/ql/src/Critical/MemoryMayNotBeFreed.cpp
2018-08-02 17:53:23 +01:00

10 lines
197 B
C++

int* f() {
try {
int *buff = malloc(SIZE*sizeof(int));
do_stuff(buff);
return buff;
} catch (int do_stuff_exception) {
return NULL; //returns NULL on error, but does not free memory
}
}