mirror of
https://github.com/github/codeql.git
synced 2026-04-28 10:15:14 +02:00
QL code and tests for C#/C++/JavaScript.
This commit is contained in:
9
cpp/ql/src/Critical/MemoryMayNotBeFreed.cpp
Normal file
9
cpp/ql/src/Critical/MemoryMayNotBeFreed.cpp
Normal file
@@ -0,0 +1,9 @@
|
||||
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
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user