[vlc-devel] commit: b4s: fix a potential memleak. ( Rémi Duraffort )

git version control git at videolan.org
Fri Aug 28 14:55:49 CEST 2009


vlc | branch: master | Rémi Duraffort <ivoire at videolan.org> | Fri Aug 28 14:55:37 2009 +0200| [83f9695932928994d999bf203ea9de0861b2a63f] | committer: Rémi Duraffort 

b4s: fix a potential memleak.

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

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

diff --git a/modules/demux/playlist/b4s.c b/modules/demux/playlist/b4s.c
index fdd69d2..0f5976e 100644
--- a/modules/demux/playlist/b4s.c
+++ b/modules/demux/playlist/b4s.c
@@ -196,7 +196,12 @@ static int Demux( demux_t *p_demux )
                 {
                     char *psz_name = xml_ReaderName( p_xml_reader );
                     char *psz_value = xml_ReaderValue( p_xml_reader );
-                    if( !psz_name || !psz_value ) return -1;
+                    if( !psz_name || !psz_value )
+                    {
+                        free( psz_name );
+                        free( psz_value );
+                        return -1;
+                    }
                     if( !strcmp( psz_elname, "entry" ) &&
                         !strcmp( psz_name, "Playstring" ) )
                     {




More information about the vlc-devel mailing list