Hello,
is there a way to detect simple memory leaks like this one with a static analysis tool? I cannot change the code to include the tipical includes used in runtime memory leak detection (struc1 is a simple structure with some fields).
void noRelease(void)
{
struc1 *memoryLeak;
memoryLeak = (struc1 *) malloc(sizeof struc1);
if (NULL != memoryLeak)
{
memoryLeak->a=3;
}
}
VSTS (Visual Studio Team System) detects memory leaks due to exceptions but is not able to see this simple leak.
Any ideas will be very helpful. Thanks a lot.