[vlc-devel] commit: Fix memleak in lua module. ( Rémi Duraffort )

git version control git at videolan.org
Fri Aug 1 23:04:35 CEST 2008


vlc | branch: master | Rémi Duraffort <ivoire at videolan.org> | Fri Aug  1 21:48:53 2008 +0200| [ea93da268c6617a0c5c98a2125b9aa27eba19d6d] | committer: Rémi Duraffort 

Fix memleak in lua module.

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

 modules/misc/lua/libs/configuration.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/modules/misc/lua/libs/configuration.c b/modules/misc/lua/libs/configuration.c
index 1ef90ac..77a69c6 100644
--- a/modules/misc/lua/libs/configuration.c
+++ b/modules/misc/lua/libs/configuration.c
@@ -54,8 +54,12 @@ static int vlclua_config_get( lua_State *L )
         case VLC_VAR_STRING:
         case VLC_VAR_FILE:
         case VLC_VAR_DIRECTORY:
-            lua_pushstring( L, config_GetPsz( p_this, psz_name ) );
+        {
+            char *psz = config_GetPsz( p_this, psz_name );
+            lua_pushstring( L, psz );
+            free( psz );
             break;
+        }
 
         case VLC_VAR_INTEGER:
             lua_pushinteger( L, config_GetInt( p_this, psz_name ) );




More information about the vlc-devel mailing list