summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVincent Penquerc'h <vincent.penquerch@collabora.co.uk>2015-01-15 16:11:24 +0000
committerVincent Penquerc'h <vincent.penquerch@collabora.co.uk>2015-01-16 16:15:26 +0000
commit5f7c5ea1f9d860bc8fabc3be85b9868323b0bfe0 (patch)
tree8c8e0225642eaa2d1ac3506d86c4fd7801dfe729
parentb9ca7a7eac98b643dd45819522f5a3be5527ef5e (diff)
downloadgstreamer-plugins-bad-5f7c5ea1f9d860bc8fabc3be85b9868323b0bfe0.tar.gz
uridownloader: a few leak fixes
-rw-r--r--gst-libs/gst/uridownloader/gsturidownloader.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/gst-libs/gst/uridownloader/gsturidownloader.c b/gst-libs/gst/uridownloader/gsturidownloader.c
index 6f2c6b039..3d5a215d2 100644
--- a/gst-libs/gst/uridownloader/gsturidownloader.c
+++ b/gst-libs/gst/uridownloader/gsturidownloader.c
@@ -261,6 +261,7 @@ gst_uri_downloader_chain (GstPad * pad, GstObject * parent, GstBuffer * buf)
GST_OBJECT_LOCK (downloader);
if (downloader->priv->download == NULL) {
/* Download cancelled, quit */
+ gst_buffer_unref (buf);
GST_OBJECT_UNLOCK (downloader);
goto done;
}
@@ -268,8 +269,10 @@ gst_uri_downloader_chain (GstPad * pad, GstObject * parent, GstBuffer * buf)
GST_LOG_OBJECT (downloader, "The uri fetcher received a new buffer "
"of size %" G_GSIZE_FORMAT, gst_buffer_get_size (buf));
downloader->priv->got_buffer = TRUE;
- if (!gst_fragment_add_buffer (downloader->priv->download, buf))
+ if (!gst_fragment_add_buffer (downloader->priv->download, buf)) {
GST_WARNING_OBJECT (downloader, "Could not add buffer to fragment");
+ gst_buffer_unref (buf);
+ }
GST_OBJECT_UNLOCK (downloader);
done:
@@ -471,6 +474,8 @@ gst_uri_downloader_fetch_uri_with_range (GstUriDownloader *
}
gst_bus_set_flushing (downloader->priv->bus, FALSE);
+ if (downloader->priv->download)
+ g_object_unref (downloader->priv->download);
downloader->priv->download = gst_fragment_new ();
GST_OBJECT_UNLOCK (downloader);
ret = gst_element_set_state (downloader->priv->urisrc, GST_STATE_READY);