chsvlib
chsv helper source code

◆ SecureFreeString()

void Chusov::String::SecureFreeString ( volatile CHAR_TYPE *  pszString)
noexcept

Performs secure deallocation of a string buffer randomizing its contents. It is designed to be a more secure version of FreeString.

Template Parameters
CHAR_TYPEis a type of the allocated string. Currently the template is defined only for CHAR_TYPE=char and CHAR_TYPE=wchar_t resolving to SecureFreeStringA and SecureFreeStringW respectively.
Parameters
pszStringis a pointer to a string buffer to be randomized and freed.
Remarks
The function requires additional time overhead for randomizing the memory. Therefore if the string has no sensitive information it may be preferable to use FreeStringW to free the buffer.
See also
FreeString;
AllocateString;
AllocateUniqueString.