souphttpsrc: fix buffer leak when flushing
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Fri, 20 May 2016 13:47:35 +0000 (16:47 +0300)
committerTim-Philipp Müller <tim@centricular.com>
Fri, 20 May 2016 16:40:26 +0000 (17:40 +0100)
When early returning in gst_soup_http_src_read_buffer() because the
element is FLUSHING, we need to unmap and unref the buffer which was just created.

https://bugzilla.gnome.org/show_bug.cgi?id=766718

ext/soup/gstsouphttpsrc.c

index 08d6cb515859b47192ee04332572b3c4afaf8634..0bd51a147c06f4782851e2b78278b141e08f2dad 100644 (file)
@@ -1570,6 +1570,8 @@ gst_soup_http_src_read_buffer (GstSoupHTTPSrc * src, GstBuffer ** outbuf)
 
   g_mutex_lock (&src->mutex);
   if (g_cancellable_is_cancelled (src->cancellable)) {
+    gst_buffer_unmap (*outbuf, &mapinfo);
+    gst_buffer_unref (*outbuf);
     g_mutex_unlock (&src->mutex);
     return GST_FLOW_FLUSHING;
   }