Original Post
I''m moderately sure I have a memory leak in one of my functions, but I''m completely out of ideas on how to fix it...
My function returns a pointer a string it just created with new... the return value of the function is immediately passed as a parameter to another function in my main loop...
char * mrexample(int length)
{
char * somestring=new char[length]; //This is never deleted
sprintf(somestring,"Blahblah"); //Putting something there...
return somestring; //Returning it...
}
//somewhere else in the program
MessageBox(0,mrexample(5),mrexample(5),MB_OK);
//Program ends
This is just a simplified version because I doubt anyone wants to wade through my code...
The memory that was allocated in mrexample never gets deleted... =/