I found some sample code that looks like:
addrinfo hints;
SecureZeroMemory(&hints, sizeof(hints));
Is there a reason to use SecureZeroM
From MSDN:
Use this function instead of
ZeroMemory
when you want to ensure that your data will be overwritten promptly, as some C++ compilers can optimize a call toZeroMemory
by removing it entirely.
Additionally a simple assignment, w/o a barrier, may be cached by hardware and not make it to the RAM for long time. Or a local variable may be optimized away. SecureZeroMemory makes sure none of that happens.
As to why use for initializing addrinfo
, a clearly non-security related concern, beats me.