title: Any reason to use SecureZeroMemory() instead of memset() or ZeroMemory() when security is not an issue?
body: <p><a href="http://msdn.microsoft.com/en-us/library/aa366877(VS.85).aspx" rel="nofollow noreferrer">This MSND article</a> says <code>SecureZeroMemory()</code> is good for cases when sensitive data stored in memory for a while should be for sure overwritten as soon as possible when no longer needed. Answers to <a href="https://stackoverflow.com/questions/786093/does-using-securezeromemory-really-help-to-make-the-application-more-secure">this SO question</a> explain why this can make a difference.</p>
  
  <p>Now is there any sence in using <code>SecureZeroMemory()</code> for initializing just every memory block? For example in one project I see code like the following:</p>
  
  <pre><code>ICONINFO ii; 
  ::SecureZeroMemory(&amp;ii, sizeof(ICONINFO)); 
  if (::GetIconInfo(hIcon, &amp;ii)) 
  {
      //do stuff, then 
      //release bitmaps 
      if(ii.hbmMask) 
          ::DeleteObject(ii.hbmMask); 
      if(ii.hbmColor) 
          ::DeleteObject(ii.hbmColor); 
  } 
  </code></pre>
  
  <p>why use <code>SecureZeroMemory()</code> here instead of <code>ZeroMemory()</code>, <code>memset()</code> or value initialization? I mean if the compiler decides initialization is unnecessary and wants to optimize it out - why would I enforce it? Is there any reason to use <code>SecureZeroMemory()</code> here?</p>