title: New/delete[] and VirtualAlloc
body: <pre><code>#include &lt;Windows.h&gt;
  #include &lt;iostream&gt;
  
  using namespace std;
  
  int main(void)
  {
      unsigned char* pFoo = new unsigned char[1000];
  
      pFoo = (unsigned char*)VirtualAlloc(NULL, 1000, MEM_COMMIT, PAGE_EXECUTE_READWRITE);
  
      VirtualFree(pFoo, 0, MEM_RELEASE);
  
      delete[] pFoo;
  
      cin.ignore();
      cin.get();
  
      return 0;
  }
  </code></pre>
  
  <p>This crashes for me at</p>
  
  <pre><code>delete[] pFoo;
  </code></pre>
  
  <p>I know this is crashing because of VirtualAlloc but I'm not sure how to fix this...</p>