Files
codeql/cpp/ql/src/Critical/DoubleFreeGood.cpp
2024-05-07 16:52:50 +01:00

8 lines
181 B
C++

int* f() {
int *buff = malloc(SIZE*sizeof(int));
do_stuff(buff);
free(buff); // GOOD: buff is only freed once.
int *new_buffer = malloc(SIZE*sizeof(int));
return new_buffer;
}