Revert "Fix memleak in mpga demuxer"
authorRafaël Carré <funman@videolan.org>
Fri, 9 May 2008 22:16:28 +0000 (00:16 +0200)
committerRafaël Carré <funman@videolan.org>
Fri, 9 May 2008 22:16:28 +0000 (00:16 +0200)
This reverts commit 9a90c961a6d1c670a9e282c99ea8da0ba7688eab.
This introduces double free
I tend to prefer a memleak as a race condition rather than a crash

modules/demux/mpeg/mpga.c

index 1c4d9ec..f0cc0c2 100644 (file)
@@ -273,7 +273,9 @@ static int Demux( demux_t *p_demux )
     {
         p_sys->b_start = false;
         p_block_in = p_sys->p_block_in;
     {
         p_sys->b_start = false;
         p_block_in = p_sys->p_block_in;
+        p_sys->p_block_in = NULL;
         p_block_out = p_sys->p_block_out;
         p_block_out = p_sys->p_block_out;
+        p_sys->p_block_out = NULL;
     }
     else
     {
     }
     else
     {
@@ -325,7 +327,6 @@ static void Close( vlc_object_t * p_this )
 
     DESTROY_PACKETIZER( p_sys->p_packetizer );
     if( p_sys->p_block_out ) block_Release( p_sys->p_block_out );
 
     DESTROY_PACKETIZER( p_sys->p_packetizer );
     if( p_sys->p_block_out ) block_Release( p_sys->p_block_out );
-    if( p_sys->p_block_in ) block_Release( p_sys->p_block_in );
 
     free( p_sys );
 }
 
     free( p_sys );
 }