modules/demux/playlist/*.c: Fix input_item memleaks.
authorPierre d'Herbemont <pdherbemont@videolan.org>
Sun, 23 Dec 2007 14:53:25 +0000 (14:53 +0000)
committerPierre d'Herbemont <pdherbemont@videolan.org>
Sun, 23 Dec 2007 14:53:25 +0000 (14:53 +0000)
12 files changed:
modules/demux/playlist/asx.c
modules/demux/playlist/b4s.c
modules/demux/playlist/dvb.c
modules/demux/playlist/gvp.c
modules/demux/playlist/ifo.c
modules/demux/playlist/itml.c
modules/demux/playlist/m3u.c
modules/demux/playlist/pls.c
modules/demux/playlist/podcast.c
modules/demux/playlist/qtl.c
modules/demux/playlist/sgimb.c
modules/demux/playlist/shoutcast.c

index ffcd138..7ff18ac 100644 (file)
@@ -527,6 +527,7 @@ static int Demux( demux_t *p_demux )
                     if( psz_moreinfo_entry ) input_item_SetURL( p_entry, psz_moreinfo_entry );
                     if( psz_abstract_entry ) input_item_SetDescription( p_entry, psz_abstract_entry );
                     input_ItemAddSubItem( p_current_input, p_entry );
+                    vlc_gc_decref( p_entry );
                 }
 
                 /* cleanup entry */;
index 7a61d61..7f0fe76 100644 (file)
@@ -266,6 +266,7 @@ static int Demux( demux_t *p_demux )
                         msg_Err( p_playlist, "Unsupported meta bitrate" );
 
                     input_ItemAddSubItem( p_current_input, p_input );
+                    vlc_gc_decref( p_input );
                     FREENULL( psz_name );
                     FREENULL( psz_mrl );
                     FREENULL( psz_genre );
index d6f3fa5..31fefce 100644 (file)
@@ -119,7 +119,7 @@ static int Demux( demux_t *p_demux )
             input_ItemAddOption( p_input, ppsz_options[i] );
         }
         input_ItemAddSubItem( p_current_input, p_input );
-
+        vlc_gc_decref( p_input );
         while( i_options-- ) free( ppsz_options[i_options] );
         if( ppsz_options ) free( ppsz_options );
 
index dd24762..f9883e1 100644 (file)
@@ -210,6 +210,7 @@ static int Demux( demux_t *p_demux )
         SADD_INFO( "docid", psz_docid );
         SADD_INFO( "description", psz_description );
         input_ItemAddSubItem( p_current_input, p_input );
+        vlc_gc_decref( p_input );
     }
 
     HANDLE_PLAY_AND_RELEASE;
index cba1972..0cd978f 100644 (file)
@@ -92,6 +92,7 @@ static int Demux( demux_t *p_demux )
 
     p_input = input_ItemNewExt( p_playlist, psz_url, psz_url, 0, NULL, -1 );
     input_ItemAddSubItem( p_current_input, p_input );
+    vlc_gc_decref( p_input );
 
     HANDLE_PLAY_AND_RELEASE;
 
index 20f5e6a..fab553d 100644 (file)
@@ -378,7 +378,8 @@ static vlc_bool_t parse_track_dict COMPLEX_INTERFACE
 
             /* add meta info */
             add_meta( p_new_input, p_track );
-
+            vlc_gc_decref( p_new_input );
+    
             p_demux->p_sys->i_ntracks++;
         }
         else
index 9cfda44..8a9e696 100644 (file)
@@ -192,6 +192,7 @@ static int Demux( demux_t *p_demux )
                 input_ItemAddInfo( p_input, _(VLC_META_INFO_CAT),
                                    _(VLC_META_ARTIST), "%s", psz_artist );
             input_ItemAddSubItem( p_current_input, p_input );
+            vlc_gc_decref( p_input );
             free( psz_mrl );
         }
 
index 135c264..ef7d059 100644 (file)
@@ -162,6 +162,7 @@ static int Demux( demux_t *p_demux )
                                             0, NULL, -1 );
                 input_ItemCopyOptions( p_current_input, p_input );
                 input_ItemAddSubItem( p_current_input, p_input );
+                vlc_gc_decref( p_input );
             }
             else
             {
@@ -221,6 +222,7 @@ static int Demux( demux_t *p_demux )
         p_input = input_ItemNewExt( p_playlist, psz_mrl, psz_name,0, NULL, -1 );
         input_ItemCopyOptions( p_current_input, p_input );
         input_ItemAddSubItem( p_current_input, p_input );
+        vlc_gc_decref( p_input );
         free( psz_mrl_orig );
         psz_mrl = NULL;
     }
index d514764..30ef2f4 100644 (file)
@@ -289,6 +289,7 @@ static int Demux( demux_t *p_demux )
                                                 psz_item_size );
                     }
                     input_ItemAddSubItem( p_current_input, p_input );
+                    vlc_gc_decref( p_input );
                     FREENULL( psz_item_name );
                     FREENULL( psz_item_mrl );
                     FREENULL( psz_item_size );
index 8e892d9..4ad9f5c 100644 (file)
@@ -357,11 +357,13 @@ static int Demux( demux_t *p_demux )
         SADD_INFO( "href", psz_href );
         SADD_INFO( "mime type", psz_mimetype );
         input_ItemAddSubItem( p_current_input, p_input );
+        vlc_gc_decref( p_input );
         if( psz_qtnext )
         {
             p_input = input_ItemNewExt( p_sys->p_playlist,
                                         psz_qtnext, NULL, 0, NULL, -1 );
             input_ItemAddSubItem( p_current_input, p_input );
+            vlc_gc_decref( p_input );
         }
     }
 
index f4c3ca3..8a9ddd6 100644 (file)
@@ -405,6 +405,7 @@ static int Demux ( demux_t *p_demux )
     }
 
     input_ItemAddSubItem( p_current_input, p_child );
+    vlc_gc_decref( p_child );
     HANDLE_PLAY_AND_RELEASE
     return 0; /* Needed for correct operation of go back */
 }
index e92d93e..9059da2 100644 (file)
@@ -236,6 +236,7 @@ static int DemuxGenre( demux_t *p_demux )
                                                 p_input );
                     free( psz_mrl );
                     input_ItemAddSubItem( p_sys->p_current_input, p_input );
+                    vlc_gc_decref( p_input );
                     FREENULL( psz_name );
                 }
                 FREENULL( psz_eltname );
@@ -423,7 +424,7 @@ static int DemuxStation( demux_t *p_demux )
                     if( psz_rt )
                         input_item_SetRating( p_input, psz_rt );
                     input_ItemAddSubItem( p_sys->p_current_input, p_input );
-
+                    vlc_gc_decref( p_input );
                     FREENULL( psz_name );
                     FREENULL( psz_mt );
                     FREENULL( psz_id );