title: cppcheck thinks there is a mismatch in alloc and dealloc
body: <p>The cpp-check error is: <code>error   mismatchAllocDealloc    false   Mismatching allocation and deallocation: val2</code></p>
  
  <p>What should I do to fix this error?</p>
  
  <pre><code>void MainWindow::ParseDemo(char *pBuf)
  {
    char* val2 = new char[256];
    for (int i = 0; i &lt; 254; i++)
    {
       val2[i] = pBuf[i+305];
    }
    val2[254] = 0; // 0-Termination
    QString sunit(val2);
    DoStuff(sunit);
    delete val2;
    // ... 
  }
  </code></pre>