[vlc-devel] commit: Fix memleak (CID 67) and don't use 0 instead of NULL ( Rémi Duraffort )

git version control git at videolan.org
Mon Oct 6 21:03:08 CEST 2008


vlc | branch: master | Rémi Duraffort <ivoire at videolan.org> | Mon Oct  6 21:01:54 2008 +0200| [7d7a42b8b0b04d620804bf408388fb9f59317604] | committer: Rémi Duraffort 

Fix memleak (CID 67) and don't use 0 instead of NULL

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

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

diff --git a/modules/demux/playlist/b4s.c b/modules/demux/playlist/b4s.c
index 629137f..c463c65 100644
--- a/modules/demux/playlist/b4s.c
+++ b/modules/demux/playlist/b4s.c
@@ -98,7 +98,7 @@ static int Demux( demux_t *p_demux )
 
     psz_elname = stream_ReadLine( p_demux->s );
     free( psz_elname );
-    psz_elname = 0;
+    psz_elname = NULL;
 
     p_xml_reader = xml_ReaderCreate( p_xml, p_demux->s );
     if( !p_xml_reader ) return -1;
@@ -142,7 +142,7 @@ static int Demux( demux_t *p_demux )
         free( psz_elname );
         return -1;
     }
-    free( psz_elname ); psz_elname = 0;
+    free( psz_elname ); psz_elname = NULL;
 
     // Read the attributes
     while( xml_ReaderNextAttr( p_xml_reader ) == VLC_SUCCESS )
@@ -294,6 +294,8 @@ static int Demux( demux_t *p_demux )
         msg_Warn( p_demux, "error while parsing data" );
     }
 
+   free( psz_elname );
+
     HANDLE_PLAY_AND_RELEASE;
     return 0; /* Needed for correct operation of go back */
 }




More information about the vlc-devel mailing list