summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorSebastian Dröge <sebastian@centricular.com>2015-07-08 23:14:13 +0300
committerSebastian Dröge <sebastian@centricular.com>2015-07-08 23:15:14 +0300
commitcd4755635111775ed2df1616e0410664b4869f81 (patch)
tree68c83e3f2501dc20e91d37cd91bbe8891d75ee2e /ext
parentd525d9c39145fed21a4a7c5dd6aae3a58f14372a (diff)
downloadgstreamer-plugins-bad-cd4755635111775ed2df1616e0410664b4869f81.tar.gz
mpdparser: Fix some memory leaks in the MPD parser and unit test
Diffstat (limited to 'ext')
-rw-r--r--ext/dash/gstmpdparser.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/ext/dash/gstmpdparser.c b/ext/dash/gstmpdparser.c
index 879ef6bd2..c46240f30 100644
--- a/ext/dash/gstmpdparser.c
+++ b/ext/dash/gstmpdparser.c
@@ -3832,7 +3832,7 @@ gst_mpd_client_get_next_fragment (GstMpdClient * client,
mediaURL =
g_strdup (gst_mpdparser_get_mediaURL (stream,
currentChunk->SegmentURL));
- indexURL = currentChunk->SegmentURL->index;
+ indexURL = g_strdup (currentChunk->SegmentURL->index);
} else if (stream->cur_seg_template != NULL) {
mediaURL =
gst_mpdparser_build_URL_from_template (stream->
@@ -3905,6 +3905,7 @@ gst_mpd_client_get_next_fragment (GstMpdClient * client,
base_url = gst_uri_from_string (stream->baseURL);
frag_url = gst_uri_from_string_with_base (base_url, mediaURL);
+ g_free (mediaURL);
if (stream->queryURL) {
frag_url = gst_uri_make_writable (frag_url);
gst_uri_set_query_string (frag_url, stream->queryURL);
@@ -3918,11 +3919,8 @@ gst_mpd_client_get_next_fragment (GstMpdClient * client,
gst_uri_set_query_string (frag_url, stream->queryURL);
fragment->index_uri = gst_uri_to_string (frag_url);
gst_uri_unref (frag_url);
- }
-
- gst_uri_unref (base_url);
-
- if (indexURL == NULL && (fragment->index_range_start
+ g_free (indexURL);
+ } else if (indexURL == NULL && (fragment->index_range_start
|| fragment->index_range_end != -1)) {
/* index has no specific URL but has a range, we should only use this if
* the media also has a range, otherwise we are serving some data twice
@@ -3936,6 +3934,8 @@ gst_mpd_client_get_next_fragment (GstMpdClient * client,
}
}
+ gst_uri_unref (base_url);
+
GST_DEBUG ("Loading chunk with URL %s", fragment->uri);
return TRUE;