[vlc-commits] lua: fix memory leak in equalizer function

Pierre Ynard git at videolan.org
Mon May 21 01:00:19 CEST 2012


vlc/vlc-2.0 | branch: master | Pierre Ynard <linkfanel at yahoo.fr> | Sun May 20 19:50:20 2012 +0200| [0fe515a30d8118e9edd7675fe0d0e506f476d04f] | committer: Pierre Ynard

lua: fix memory leak in equalizer function
(cherry picked from commit e52f2154aeb9260b08ca063d30d7f8739a3bf95b)

Signed-off-by: Pierre Ynard <linkfanel at yahoo.fr>

> http://git.videolan.org/gitweb.cgi/vlc/vlc-2.0.git/?a=commit;h=0fe515a30d8118e9edd7675fe0d0e506f476d04f
---

 modules/lua/libs/equalizer.c |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/modules/lua/libs/equalizer.c b/modules/lua/libs/equalizer.c
index 42d31f5..4a8fb96 100644
--- a/modules/lua/libs/equalizer.c
+++ b/modules/lua/libs/equalizer.c
@@ -268,9 +268,11 @@ static int vlclua_equalizer_setpreset( lua_State *L )
         char *psz_af = var_GetNonEmptyString( p_aout, "audio-filter" );
         if( !psz_af || strstr ( psz_af, "equalizer" ) == NULL )
         {
+            free( psz_af );
             vlc_object_release( p_aout );
             return 0;
         }
+        free( psz_af );
         char *newstr;
         if( asprintf( &newstr , "%6.1f" , eqz_preset_10b[presetid].f_amp[0] ) == -1 )
             return 0;



More information about the vlc-commits mailing list