[vlc-commits] commit: relative_URI memory leak cleanup (Brian Kurle )

git at videolan.org git at videolan.org
Thu Dec 2 10:59:53 CET 2010


vlc | branch: master | Brian Kurle <Brian.Kurle at arrisi.com> | Thu Dec  2 00:04:00 2010 +0100| [392c7b8a555ed9994256757c0350ebc4a251ddee] | committer: Jean-Paul Saman 

relative_URI memory leak cleanup

If the the link is relative, psz_uri is dynamically allocated a string of the
absolute URI (which is also returned by the function).   However, if it isn't,
NULL is returned and nothing is allocated.   segment_New performs a strdup, so
the pointer is not saved.   Thus, check if the allocation occurred and clean up
if needed.

Signed-off-by: Jean-Paul Saman <jean-paul.saman at m2x.nl>

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=392c7b8a555ed9994256757c0350ebc4a251ddee
---

 modules/stream_filter/httplive.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/modules/stream_filter/httplive.c b/modules/stream_filter/httplive.c
index e984dd1..d57defc 100644
--- a/modules/stream_filter/httplive.c
+++ b/modules/stream_filter/httplive.c
@@ -388,6 +388,8 @@ static void parse_SegmentInformation(stream_t *s, hls_stream_t *hls, char *p_rea
                 duration, hls->duration);
     }
     vlc_mutex_unlock(&hls->lock);
+
+    free(psz_uri);
 }
 
 static void parse_TargetDuration(stream_t *s, hls_stream_t *hls, char *p_read)
@@ -451,6 +453,8 @@ static void parse_StreamInformation(stream_t *s, char *p_read, char *uri)
     hls_stream_t *hls = hls_New(p_sys->hls_stream, id, bw, psz_uri ? psz_uri : uri);
     if (hls == NULL)
         p_sys->b_error = true;
+
+    free(psz_uri);
 }
 
 static void parse_MediaSequence(stream_t *s, hls_stream_t *hls, char *p_read)



More information about the vlc-commits mailing list