demux: fix a memory leak in flac & mpga when attachments are present
authorRafaël Carré <funman@videolan.org>
Tue, 2 Oct 2007 02:50:10 +0000 (02:50 +0000)
committerRafaël Carré <funman@videolan.org>
Tue, 2 Oct 2007 02:50:10 +0000 (02:50 +0000)
modules/demux/flac.c
modules/demux/mpeg/mpga.c

index 0943d70..ab88625 100644 (file)
@@ -206,6 +206,10 @@ static void Close( vlc_object_t * p_this )
     demux_sys_t *p_sys = p_demux->p_sys;
 
     TAB_CLEAN( p_sys->i_seekpoint, p_sys->seekpoint );
+
+    int i;
+    for( i = 0; i < p_sys->i_attachments; i++ )
+        free( p_sys->attachments[i] );
     TAB_CLEAN( p_sys->i_attachments, p_sys->attachments);
 
     /* Unneed module */
index a66c791..6e0b565 100644 (file)
@@ -347,6 +347,9 @@ static void Close( vlc_object_t * p_this )
     if( p_sys->meta ) vlc_meta_Delete( p_sys->meta );
     if( p_sys->p_block_out ) block_Release( p_sys->p_block_out );
 
+    int i;
+    for( i = 0; i < p_sys->i_attachments; i++ )
+        free( p_sys->attachments[i] );
     TAB_CLEAN( p_sys->i_attachments, p_sys->attachments);
 
     free( p_sys );