150
edits
Changes
→Pointer Miss Management {Memory Leak}
== Pointer Miss Management {Memory Leak} ==
The Below code creates a dynamically allocated array of Integer pointers and allocates a new integer into each index.
In the Second For loop, the code goes onto make every even-numbered pointer point towards the next highest odd-numbered pointers memory address.
This Effectively causes a memory leak where half of the allocated memory locations no longer have any pointers pointing to them. After this, the code goes onto perform a delete operation on every pointer in an attempt to fool the Parallel Studio debugger.
<syntaxhighlight lang="cpp" line='line'>
[[File:FalsePositive.png]]
== False Positive ==