title: Possible null pointer dereference - otherwise it is redundant to check it against null
body: <p>I have the following code, which is working properly:</p>
  
  <pre><code>int result = ERRORCODE_OK;
  if (dataObj == NULL || dataObj-&gt;inputSignal == NULL)
  {
     result = ERRORCODE_MISSING_DATAOBJ;
  }
  if (result == ERRORCODE_OK &amp;&amp; dataObj-&gt;spectrum == NULL) // CPP-Check error
  {
     result = Calculate(dataObj-&gt;inputSignal, .. );
  } 
  return result;
  </code></pre>
  
  <p>But CppCheck gives me the following error:</p>
  
  <blockquote>
    <p>Possible null pointer dereference: <code>dataObj</code> - otherwise it is redundant to check it against null.</p>
  </blockquote>
  
  <p>I don't understand why. If the <code>dataobj</code> is <code>NULL</code>, then the result will be something else then <code>ERRORCODE_OK</code>.</p>