From 8e9ba056d7682acc1fac674fcc5ad3d815282670 Mon Sep 17 00:00:00 2001 From: Gianluca Gennari Date: Fri, 19 Oct 2012 12:01:03 +0200 Subject: [PATCH] mpdparser: fix memory leak in gst_mpd_client_get_next_fragment_set() we have to free next_fragment_uri --- ext/dash/gstdashdemux.c | 3 ++- ext/dash/gstmpdparser.c | 2 +- ext/dash/gstmpdparser.h | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/ext/dash/gstdashdemux.c b/ext/dash/gstdashdemux.c index c3841d05ea..9c9a6ba34e 100644 --- a/ext/dash/gstdashdemux.c +++ b/ext/dash/gstdashdemux.c @@ -1477,7 +1477,7 @@ gst_dash_demux_get_next_fragment_set (GstDashDemux * demux) GstActiveStream *stream; GstFragment *download, *header; GList *fragment_set; - const gchar *next_fragment_uri; + gchar *next_fragment_uri; GstClockTime duration; GstClockTime timestamp; gboolean discont; @@ -1512,6 +1512,7 @@ gst_dash_demux_get_next_fragment_set (GstDashDemux * demux) download = gst_uri_downloader_fetch_uri (demux->downloader, next_fragment_uri); + g_free (next_fragment_uri); if (download == NULL) return FALSE; diff --git a/ext/dash/gstmpdparser.c b/ext/dash/gstmpdparser.c index fba97f0f77..97606534a6 100644 --- a/ext/dash/gstmpdparser.c +++ b/ext/dash/gstmpdparser.c @@ -2750,7 +2750,7 @@ gst_mpd_client_setup_streaming (GstMpdClient * client, gboolean gst_mpd_client_get_next_fragment (GstMpdClient * client, - guint indexStream, gboolean *discontinuity, const gchar **uri, + guint indexStream, gboolean *discontinuity, gchar **uri, GstClockTime *duration, GstClockTime *timestamp) { GstActiveStream *stream = NULL; diff --git a/ext/dash/gstmpdparser.h b/ext/dash/gstmpdparser.h index b52a9485f9..83582cc3b2 100644 --- a/ext/dash/gstmpdparser.h +++ b/ext/dash/gstmpdparser.h @@ -449,7 +449,7 @@ gboolean gst_mpd_client_setup_representation (GstMpdClient *client, GstActiveStr void gst_mpd_client_get_current_position (GstMpdClient *client, GstClockTime * timestamp); GstClockTime gst_mpd_client_get_duration (GstMpdClient *client); GstClockTime gst_mpd_client_get_target_duration (GstMpdClient *client); -gboolean gst_mpd_client_get_next_fragment (GstMpdClient *client, guint indexStream, gboolean *discontinuity, const gchar **uri, GstClockTime *duration, GstClockTime *timestamp); +gboolean gst_mpd_client_get_next_fragment (GstMpdClient *client, guint indexStream, gboolean *discontinuity, gchar **uri, GstClockTime *duration, GstClockTime *timestamp); gboolean gst_mpd_client_get_next_header (GstMpdClient *client, const gchar **uri, guint stream_idx); gboolean gst_mpd_client_is_live (GstMpdClient * client);