So I'm working on a project written by someone else which is too big to debug without the help of some tools. I have to use visual studio 2005 and I'm getting memory corruption where an attempt is made to free a resource after its already been freed. So I imagine something a bit like this is happening:
#include <iostream>
using namespace std;
void main()
{
int * data = new int;
delete data;
data += 100;
int wait;
cin >> wait;
delete data;
}
The problem is that the in built debugger doesn't help much at all... It only tells me something's wrong when the block that was freed twice is later allocated again (I think this is what's happening anyway).
So I'm hoping someone can recommend some tools that can point me to the line where the delete which is doing the damage is located? Or am I going to have to just do it manually?
Many thanks to anyone who can help me!