souphttpsrc: fix buffer leak when flushing

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
This commit is contained in:
Guillaume Desmottes 2016-05-20 16:47:35 +03:00 committed by Tim-Philipp Müller
parent 7cd9d34c80
commit 6fd04b07fc

View file

@ -1570,6 +1570,8 @@ gst_soup_http_src_read_buffer (GstSoupHTTPSrc * src, GstBuffer ** outbuf)
g_mutex_lock (&src->mutex); g_mutex_lock (&src->mutex);
if (g_cancellable_is_cancelled (src->cancellable)) { if (g_cancellable_is_cancelled (src->cancellable)) {
gst_buffer_unmap (*outbuf, &mapinfo);
gst_buffer_unref (*outbuf);
g_mutex_unlock (&src->mutex); g_mutex_unlock (&src->mutex);
return GST_FLOW_FLUSHING; return GST_FLOW_FLUSHING;
} }