Commit e52f2154 authored by Pierre Ynard's avatar Pierre Ynard

lua: fix memory leak in equalizer function

parent 41106eaa
...@@ -265,9 +265,11 @@ static int vlclua_equalizer_setpreset( lua_State *L ) ...@@ -265,9 +265,11 @@ static int vlclua_equalizer_setpreset( lua_State *L )
char *psz_af = var_GetNonEmptyString( p_aout, "audio-filter" ); char *psz_af = var_GetNonEmptyString( p_aout, "audio-filter" );
if( !psz_af || strstr ( psz_af, "equalizer" ) == NULL ) if( !psz_af || strstr ( psz_af, "equalizer" ) == NULL )
{ {
free( psz_af );
vlc_object_release( p_aout ); vlc_object_release( p_aout );
return 0; return 0;
} }
free( psz_af );
char *newstr; char *newstr;
if( asprintf( &newstr , "%6.1f" , eqz_preset_10b[presetid].f_amp[0] ) == -1 ) if( asprintf( &newstr , "%6.1f" , eqz_preset_10b[presetid].f_amp[0] ) == -1 )
return 0; return 0;
......
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