title: Access violation when using double pointer
body: <p>I have a function <code>func()</code> that takes a double pointer. If that points to zero, the function exits (first check). Now without the second check, I get an access violation trying to access the member of <code>mybar</code> (when I run the function a second time only). Why is that? If <code>mybar == NULL</code> shouldn't it exit at the first check?</p>
  
  <pre><code>func( Foo **bar )
  {
      //First check
      if(bar== NULL)
      return;
  
      Foo *mybar = *bar;
  
      //Second check
      if(mybar == NULL)
          return;
  
      if(mybar-&gt;member != NULL)  //Access violation here if I dont have the 'second check'
      {
          //do stuff
      }    
      delete mybar;
  
      *bar = NULL;
  
  }
  </code></pre>
  
  <p>Thats how I call it:</p>
  
  <pre><code>Foo *bar = NULL;
  initialize(&amp;bar); 
  func(&amp;bar);
  func(&amp;bar); //Second time I call it, I get the access violation
  </code></pre>