]> git.sesse.net Git - vlc/commitdiff
Fix invalid free() on exit
authorRémi Denis-Courmont <rem@videolan.org>
Sun, 10 Apr 2005 16:13:40 +0000 (16:13 +0000)
committerRémi Denis-Courmont <rem@videolan.org>
Sun, 10 Apr 2005 16:13:40 +0000 (16:13 +0000)
modules/demux/playlist/b4s.c

index fbe0de66dc1257215331062484d9c2a9fe36a444..099341705c151e98fd032c694d98671abab9caaa 100644 (file)
@@ -59,6 +59,7 @@ static void ShoutcastAdd( playlist_t *p_playlist, playlist_item_t* p_genre,
 int Import_B4S( vlc_object_t *p_this )
 {
     demux_t *p_demux = (demux_t *)p_this;
+    demux_sys_t *p_sys;
 
     char    *psz_ext;
 
@@ -78,15 +79,18 @@ int Import_B4S( vlc_object_t *p_this )
 
     p_demux->pf_control = Control;
     p_demux->pf_demux = Demux;
-    p_demux->p_sys = malloc( sizeof(demux_sys_t) );
-    if( p_demux->p_sys == NULL )
+    p_demux->p_sys = p_sys = malloc( sizeof(demux_sys_t) );
+    if( p_sys == NULL )
     {
         msg_Err( p_demux, "Out of memory" );
         return VLC_ENOMEM;
     }
-    p_demux->p_sys->b_shout = p_demux->psz_demux &&
+    p_sys->b_shout = p_demux->psz_demux &&
         !strcmp(p_demux->psz_demux, "shout-b4s");
-    p_demux->p_sys->psz_prefix = FindPrefix( p_demux );
+    p_sys->psz_prefix = FindPrefix( p_demux );
+    p_sys->p_playlist = NULL;
+    p_sys->p_xml = NULL;
+    p_sys->p_xml_reader = NULL;
 
     return VLC_SUCCESS;
 }