chsvlib
chsv helper source code

◆ SecureFreeData()

bool Chusov::Memory::SecureFreeData ( volatile void *  pData)
noexcept

Randomizes and frees memory occupied by the specified buffer allocated using one of the Allocate* functions of the Chusov::Memory namespace. It is designed to be a more secure version of FreeData.

Parameters
pDatais a pointer to the buffer to be randomized and freed.
Returns
The function returns true on success and false on failure. Use GetLastChsvError function to get extended error information.
Remarks
The function is a wrap over the FreeData function. It performs randomizing memory before deallocating the memory. Obviously this requires additional time overhead over the FreeData function. Therefore if you do not require secure deallocation it can be preferable to use the FreeData.
See also
SecureFreeString;
RandomizeMemory;
FreeData;
AllocateData;
AllocateStringW.