title: Memory Leaks while using gstbuffer
body: <p>I have a pipeline, which takes data from webcam and process it.</p>
  
  <p>For the processing i need to pull that buffer to <strong>appsink</strong> and push it into pipeline by using <strong>appsrc</strong> element.</p>
  
  <p>While pushing i had used <strong>gst_buffer_new_wrapped</strong> function.</p>
  
  <p>Then a new buffer is allocated every time i am pushing the data. But how to free that memory is the problem.</p>
  
  <p>I had tried gst_buffer_unref(buffer);</p>
  
  <p>Then got below error.</p>
  
  <pre><code> Error in `./uuHiesSoaServer': free(): invalid pointer: 0x00007fddf52f6000 
  </code></pre>
  
  <p>I had take the data into an unsigned char pointer and then wrapped into a gstbuffer based on the size.</p>
  
  <p>Now how to free the allocated memory?</p>
  
  <pre><code>g_signal_emit_by_name (Source, "push-buffer", Buffer, &amp;ret);
  </code></pre>
  
  <p>I had used above function for pushing data into Source(appsrc).</p>
  
  <p>That function will continuously call on a separate thread.</p>
  
  <p>When data available to it, then the thread function will create a buffer using </p>
  
  <pre><code>gst_buffer_new_wrapped((void *)data, Size);
  </code></pre>
  
  <p>When checking in valgrind, for memory leaks, above line was shown as a leak.</p>
  
  <p>How to solve this?</p>