[vlc-devel] commit: m3u: Fix 3 leaks. (Pierre d'Herbemont )

git version control git at videolan.org
Fri Jan 29 11:49:33 CET 2010


vlc | branch: master | Pierre d'Herbemont <pdherbemont at free.fr> | Thu Jan 28 20:21:03 2010 +0100| [d7413881446ced9dc7db422f5dc31c410df8b815] | committer: Pierre d'Herbemont 

m3u: Fix 3 leaks.

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

 modules/demux/playlist/m3u.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/modules/demux/playlist/m3u.c b/modules/demux/playlist/m3u.c
index cef756e..e4168ad 100644
--- a/modules/demux/playlist/m3u.c
+++ b/modules/demux/playlist/m3u.c
@@ -170,6 +170,8 @@ static int Demux( demux_t *p_demux )
             {
                 /* Extended info */
                 psz_parse += sizeof("EXTINF:") - 1;
+                free(psz_name);
+                free(psz_artist);
                 parseEXTINF( psz_parse, &psz_artist, &psz_name, &i_parsed_duration );
                 if( i_parsed_duration >= 0 )
                     i_duration = i_parsed_duration * INT64_C(1000000);
@@ -208,7 +210,11 @@ static int Demux( demux_t *p_demux )
             psz_mrl = ProcessMRL( psz_parse, p_demux->p_sys->psz_prefix );
 
             b_cleanup = true;
-            if( !psz_mrl ) goto error;
+            if( !psz_mrl )
+            {
+                LocaleFree( psz_parse );
+                goto error;
+            }
 
             p_input = input_item_NewExt( p_demux, psz_mrl, psz_name,
                                         i_options, ppsz_options, 0, i_duration );




More information about the vlc-devel mailing list