[vlc-commits] zpl: Fix memory leaks

Rémi Duraffort git at videolan.org
Fri Aug 9 10:24:36 CEST 2013


vlc | branch: master | Rémi Duraffort <ivoire at videolan.org> | Thu Aug  8 18:43:11 2013 +0200| [aa62e2309f23b3b52812d91a36b97eee073f56b9] | committer: Jean-Baptiste Kempf

zpl: Fix memory leaks

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

 modules/demux/playlist/zpl.c |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/modules/demux/playlist/zpl.c b/modules/demux/playlist/zpl.c
index 0d15cce..f909c47 100644
--- a/modules/demux/playlist/zpl.c
+++ b/modules/demux/playlist/zpl.c
@@ -119,6 +119,7 @@ static int Demux( demux_t *p_demux )
             char *psz_tabvalue = ParseTabValue( psz_parse );
             if( !EMPTY_STR(psz_tabvalue) )
             {
+                free( psz_mrl );
                 psz_mrl = ProcessMRL( psz_tabvalue, p_demux->p_sys->psz_prefix );
             }
             free( psz_tabvalue );
@@ -139,7 +140,10 @@ static int Demux( demux_t *p_demux )
 
 #define PARSE(tag,variable)                                     \
     else if( !strncasecmp( psz_parse, tag, strlen( tag ) ) )    \
-        variable = ParseTabValue( psz_parse );
+    {                                                           \
+        free( variable );                                       \
+        variable = ParseTabValue( psz_parse );                  \
+    }
 
         PARSE( "TT", psz_title )
         PARSE( "TG", psz_genre )



More information about the vlc-commits mailing list