I recently installed VLD for a Visual C++ 2012 project. To test that it was working I used the following code:
main()
{
LPSTR lpTemp;
lpTemp = (LPSTR) malloc(200);
}
That worked as expected and VLD reported a memory leak at the correct line. But when the code was changed to:
main()
{
HANDLE hTemp;
hTemp = GlobalAlloc(GPTR,200);
}
VLD did not report a memory leak even though there is no associated GlobalFree. Why?
main()
{
LPSTR lpTemp;
lpTemp = (LPSTR) malloc(200);
}
That worked as expected and VLD reported a memory leak at the correct line. But when the code was changed to:
main()
{
HANDLE hTemp;
hTemp = GlobalAlloc(GPTR,200);
}
VLD did not report a memory leak even though there is no associated GlobalFree. Why?