[vlc-commits] Revert "asx: fix many memory leaks (and cid #1109641)"

Jean-Baptiste Kempf git at videolan.org
Fri Apr 10 10:33:18 CEST 2015


vlc/vlc-2.2 | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Fri Apr 10 10:29:08 2015 +0200| [270c2b196f5f9012f5928791884d572b08a090b6] | committer: Jean-Baptiste Kempf

Revert "asx: fix many memory leaks (and cid #1109641)"

This reverts commit 7e94e20bb5ee9a1014fa08f51c04f2293f21ea7a.

Ref #14062

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

 modules/demux/playlist/asx.c |   18 ++++++------------
 1 file changed, 6 insertions(+), 12 deletions(-)

diff --git a/modules/demux/playlist/asx.c b/modules/demux/playlist/asx.c
index 1898cdd..49d0a40 100644
--- a/modules/demux/playlist/asx.c
+++ b/modules/demux/playlist/asx.c
@@ -312,8 +312,6 @@ static int Demux( demux_t *p_demux )
     char *psz_entryref = NULL;
 
     xml_reader_t *p_xml_reader = NULL;
-    input_item_t *p_current_input = GetCurrentItem( p_demux );
-    input_item_node_t *p_subitems = NULL;
 
     bool b_first_node = false;
     int i_type;
@@ -326,7 +324,8 @@ static int Demux( demux_t *p_demux )
         goto error;
     }
 
-    p_subitems = input_item_node_Create( p_current_input );
+    input_item_t *p_current_input = GetCurrentItem( p_demux );
+    input_item_node_t *p_subitems = input_item_node_Create( p_current_input );
 
     do
     {
@@ -425,22 +424,17 @@ static int Demux( demux_t *p_demux )
     }
     while( i_type != XML_READER_ENDELEM || strncasecmp( psz_node, "ASX", 3 ) );
 
-    input_item_node_PostAndDelete( p_subitems );
-    p_subitems = NULL;
-
-
-error:
     free( psz_base );
     free( psz_title_asx );
     free( psz_entryref );
     free( psz_txt );
 
+    input_item_node_PostAndDelete( p_subitems );
+    vlc_gc_decref( p_current_input );
+
+error:
     if( p_xml_reader)
         xml_ReaderDelete( p_xml_reader );
-    if( p_subitems )
-        input_item_node_Delete( p_subitems );
-
-    vlc_gc_decref( p_current_input );
 
     return 0;
 }



More information about the vlc-commits mailing list