Quantcast
Channel: Visual Leak Detector for Visual C++ 2008-2015
Viewing all articles
Browse latest Browse all 704

Created Unassigned: Does not detect unmatched GlobalAlloc/GlobalFree call [10545]

$
0
0
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?

Viewing all articles
Browse latest Browse all 704

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>