mpdparser: fix memory leak in gst_mpd_client_get_next_fragment_set()
authorGianluca Gennari <gennarone@gmail.com>
Fri, 19 Oct 2012 10:01:03 +0000 (12:01 +0200)
committerThiago Santos <thiago.sousa.santos@collabora.com>
Wed, 8 May 2013 21:14:03 +0000 (18:14 -0300)
we have to free next_fragment_uri

ext/dash/gstdashdemux.c
ext/dash/gstmpdparser.c
ext/dash/gstmpdparser.h

index c3841d0..9c9a6ba 100644 (file)
@@ -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;
index fba97f0..9760653 100644 (file)
@@ -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;
index b52a948..83582cc 100644 (file)
@@ -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);