We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fb3140a commit bdda2a7Copy full SHA for bdda2a7
cpp/ql/src/Critical/DoubleFreeBad.cpp
@@ -4,9 +4,9 @@ int* f() {
4
do_stuff(buff);
5
free(buff);
6
int *new_buffer = malloc(SIZE*sizeof(int));
7
- free(buff); // BAD: If new_buffer is assigned the same address as buff,
8
- // the memory allocator will free the new buffer memory region,
9
- // leading to use-after-free problems and memory corruption.
10
-
+ free(buff);
+ // BAD: If new_buffer is assigned the same address as buff,
+ // the memory allocator will free the new buffer memory region,
+ // leading to use-after-free problems and memory corruption.
11
return new_buffer;
12
}
0 commit comments