summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim-Philipp Müller <tim@centricular.com>2015-12-19 20:59:12 +0000
committerTim-Philipp Müller <tim@centricular.com>2015-12-19 21:06:02 +0000
commit8be5551dff8037a3b576c954a7660b56e3da430f (patch)
tree2e78521a1da6128bee06c751cf706caeff960f6b
parentd59413ba0696ecd27ae7192f5a04572d60740dda (diff)
downloadgstreamer-plugins-bad-8be5551dff8037a3b576c954a7660b56e3da430f.tar.gz
hlsdemux: fix potential error leak
Clear error as soon as we determine that the download failed, otherwise there are code paths where we might return without clearing it ever, which would leak the GError then. Also, we can pass a NULL GError pointer to _fetch_uri(), so just do that instead of passing one that we're going to just free again right away anyway.
-rw-r--r--ext/hls/gsthlsdemux.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/ext/hls/gsthlsdemux.c b/ext/hls/gsthlsdemux.c
index f2b7d44f9..7c8659eaf 100644
--- a/ext/hls/gsthlsdemux.c
+++ b/ext/hls/gsthlsdemux.c
@@ -827,18 +827,17 @@ retry:
TRUE, TRUE, TRUE, err);
g_free (main_uri);
if (download == NULL) {
+ g_clear_error (err);
if (update && !main_checked
&& gst_m3u8_client_has_variant_playlist (demux->client)) {
- GError *err2 = NULL;
main_uri = gst_m3u8_client_get_uri (demux->client);
GST_INFO_OBJECT (demux,
"Updating playlist %s failed, attempt to refresh variant playlist %s",
uri, main_uri);
download =
gst_uri_downloader_fetch_uri (adaptive_demux->downloader,
- main_uri, NULL, TRUE, TRUE, TRUE, &err2);
+ main_uri, NULL, TRUE, TRUE, TRUE, NULL);
g_free (main_uri);
- g_clear_error (&err2);
if (download != NULL) {
gchar *base_uri;
@@ -872,7 +871,6 @@ retry:
g_object_unref (download);
- g_clear_error (err);
main_checked = TRUE;
goto retry;
} else {