Fixed sout leak on access error.
authorLaurent Aimar <fenrir@videolan.org>
Wed, 7 Mar 2007 22:38:34 +0000 (22:38 +0000)
committerLaurent Aimar <fenrir@videolan.org>
Wed, 7 Mar 2007 22:38:34 +0000 (22:38 +0000)
src/input/input.c

index 8c3ab2d..0db5df1 100644 (file)
@@ -398,8 +398,8 @@ int __input_Preparse( vlc_object_t *p_parent, input_item_t *p_item )
     if( !p_input )
         return VLC_EGENERIC;
 
-    Init( p_input );
-    End( p_input );
+    if( !Init( p_input ) )
+        End( p_input );
 
     Destroy( p_input, NULL );
 
@@ -1166,7 +1166,10 @@ error:
         input_EsOutDelete( p_input->p->p_es_out );
 
     if( p_input->p->p_sout )
+    {
         vlc_object_detach( p_input->p->p_sout );
+        sout_DeleteInstance( p_input->p->p_sout );
+    }
 
     /* Mark them deleted */
     p_input->p->input.p_demux = NULL;