PREfast Warning 250 (Windows CE 5.0)
250 - Callingl <function> without the MEM_RELEASE flag frees memory but not the address descriptors (VADs).
Consequence: Results in address space leaks.
This message warns that you must use MEM_RELEASE with VirtualFree to undo reserve memory that was reserved or committed using VirtualAlloc.
VirtualAlloc can reserve or commit memory; a commit of memory also reserves it. MEM_DECOMMIT undoes the commit, but not the reserve; MEM_RELEASE undoes the reserve.
If a page is decommitted but not released when using VirtualFree, the page state changes to reserved. To completely release committed memory, the page must be decommitted and released.
Releasing committed memory also decommits associated pages.
Example
Defective Source
VirtualFree(NULL,
0,
MEM_DECOMMIT);
VirtualFree(NULL,
0,
MEM_RELEASE);
Corrected Source
VirtualFree(NULL,
0,
MEM_RELEASE);
Send Feedback on this topic to the authors