diff --git a/cpp/ql/src/Critical/DoubleFreeBad.cpp b/cpp/ql/src/Critical/DoubleFreeBad.cpp index 92b12ea5bcbc..1061142d11b4 100644 --- a/cpp/ql/src/Critical/DoubleFreeBad.cpp +++ b/cpp/ql/src/Critical/DoubleFreeBad.cpp @@ -1,10 +1,13 @@ + int* f() { int *buff = malloc(SIZE*sizeof(int)); do_stuff(buff); free(buff); int *new_buffer = malloc(SIZE*sizeof(int)); - 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. + 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. + // abc return new_buffer; }