[vlc-devel] commit: itml: fix dead initilisations and set the pointers to NULL only when needed. ( Rémi Duraffort )

git version control git at videolan.org
Wed Jul 15 16:21:29 CEST 2009


vlc | branch: master | Rémi Duraffort <ivoire at videolan.org> | Wed Jul 15 16:11:47 2009 +0200| [042c1938f4e2b8d1110149c7c2a00855368f7a25] | committer: Rémi Duraffort 

itml: fix dead initilisations and set the pointers to NULL only when needed.

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

 modules/demux/playlist/itml.c |   12 +++++++-----
 1 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/modules/demux/playlist/itml.c b/modules/demux/playlist/itml.c
index 67f7005..887b9cb 100644
--- a/modules/demux/playlist/itml.c
+++ b/modules/demux/playlist/itml.c
@@ -67,7 +67,7 @@ void Close_iTML( vlc_object_t *p_this )
  */
 int Demux( demux_t *p_demux )
 {
-    xml_t *p_xml = NULL;
+    xml_t *p_xml;
     xml_reader_t *p_xml_reader = NULL;
     char *psz_name = NULL;
 
@@ -237,7 +237,7 @@ static bool parse_dict( demux_t *p_demux, input_item_t *p_input_item,
 
             case XML_READER_TEXT:
                 /* simple element content */
-                FREE_ATT();
+                free( psz_value );
                 psz_value = xml_ReaderValue( p_xml_reader );
                 if( !psz_value )
                 {
@@ -292,7 +292,9 @@ static bool parse_dict( demux_t *p_demux, input_item_t *p_input_item,
     msg_Err( p_demux, "unexpected end of xml data" );
 
 end:
-    FREE_ATT_KEY();
+    free( psz_name );
+    free( psz_value );
+    free( psz_key );
     return b_ret;
 }
 
@@ -346,7 +348,7 @@ static bool parse_track_dict( demux_t *p_demux, input_item_t *p_input_item,
 {
     VLC_UNUSED(psz_element); VLC_UNUSED(p_handlers);
     input_item_t *p_new_input = NULL;
-    int i_ret = -1;
+    int i_ret;
     char *psz_uri = NULL;
     p_track = new_track();
 
@@ -407,7 +409,7 @@ static bool parse_track_dict( demux_t *p_demux, input_item_t *p_input_item,
 
 static track_elem_t *new_track()
 {
-    track_elem_t *p_track = NULL;
+    track_elem_t *p_track;
     p_track = malloc( sizeof( track_elem_t ) );
     if( p_track )
     {




More information about the vlc-devel mailing list