title: Free buffer with data
body: <p>Im using this code to get data from QTcpSocket. I read data in buffer and then if I free it immediately its fine. But if I free it later the application crashes.
  QtDocs says that I have to clean up memory with delete[] after using method readBytes</p>
  
  <pre><code>void Widget::slotReadClient()
  {
      QTcpSocket* pClientSocket = (QTcpSocket*)sender();
      QDataStream in(pClientSocket);
      in.setVersion(QDataStream::Qt_4_7);
      for (;;)
      {
          if (!m_nNextBlockSize)
          {
              if (pClientSocket-&gt;bytesAvailable() &lt; sizeof(quint16))
              {
                  break;
              }
              in &gt;&gt; m_nNextBlockSize;
          }
          if (pClientSocket-&gt;bytesAvailable() &lt; m_nNextBlockSize)
          {
              break;
          }
        QString attribute;
       quint16 count=0;
        in&gt;&gt;count;//count of massives
       quint16 els=count;
       uint len=0;
       char** wkbs;
       if(count)
            wkbs=new char*[els];
       int j=0;
       char* buf=0;
  
        while(count)
        {
            in&gt;&gt;attribute;//description its ok
            buf=wkbs[j];
            buf=0;
            in.readBytes(buf,len);
            ui-&gt;plainTextEdit-&gt;appendPlainText(QString::number(len));//length of buffer ok
            j++;
            count--;
            processGeom(buf);//data is OK
            //delete [] buf; if I use this it works
        }
        ui-&gt;plainTextEdit-&gt;appendPlainText(QString::number(els));
        j=0;
        while(els)
        {
            buf=wkbs[j];
            delete[] buf;//here I get crash
            els--;
            j++;
        }
        delete[] wkbs;
        m_nNextBlockSize = 0;
      }
  }
  </code></pre>