input: fix leak with 0 titles arrays
authorFrancois Cartegnie <fcvlcdev@free.fr>
Wed, 8 Jan 2020 10:02:56 +0000 (11:02 +0100)
committerFrancois Cartegnie <fcvlcdev@free.fr>
Wed, 8 Jan 2020 18:29:02 +0000 (19:29 +0100)
src/input/input.c

index 977c230..7ba4f0d 100644 (file)
@@ -2387,8 +2387,8 @@ static void UpdateTitleListfromDemux( input_thread_t *p_input )
     {
         for( int i = 0; i < in->i_title; i++ )
             vlc_input_title_Delete( in->title[i] );
-        TAB_CLEAN( in->i_title, in->title );
     }
+    TAB_CLEAN( in->i_title, in->title );
 
     /* Get the new title list */
     if( demux_Control( in->p_demux, DEMUX_GET_TITLE_INFO,
@@ -2726,8 +2726,8 @@ static void InputSourceDestroy( input_source_t *in )
     {
         for( i = 0; i < in->i_title; i++ )
             vlc_input_title_Delete( in->title[i] );
-        TAB_CLEAN( in->i_title, in->title );
     }
+    TAB_CLEAN( in->i_title, in->title );
 
     free( in );
 }