Commit 73e24627 authored by Edward Wang's avatar Edward Wang Committed by Jean-Baptiste Kempf

visual: check for NULL before free

Close #6879
Signed-off-by: default avatarJean-Baptiste Kempf <jb@videolan.org>
parent a5a428df
......@@ -373,20 +373,23 @@ static void Close( vlc_object_t *p_this )
for( int i = 0; i < p_sys->i_effect; i++ )
{
#define p_effect p_sys->effect[i]
if( p_effect->p_data != NULL )
{
if( !strncmp( p_effect->psz_name, "spectrum", strlen( "spectrum" ) ) )
{
spectrum_data *p_data = p_effect->p_data;
spectrum_data* p_data = p_effect->p_data;
free( p_data->peaks );
free( p_data->prev_heights );
free( p_data->p_prev_s16_buff );
}
if( !strncmp( p_effect->psz_name, "spectrometer", strlen( "spectrometer" ) ) )
{
spectrometer_data *p_data = p_effect->p_data;
spectrometer_data* p_data = p_effect->p_data;
free( p_data->peaks );
free( p_data->p_prev_s16_buff );
}
free( p_effect->p_data );
}
free( p_effect->psz_args );
free( p_effect );
#undef p_effect
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment