[vlc-devel] commit: lua: fix potential memleak. ( Rémi Duraffort )

git version control git at videolan.org
Sat Oct 10 11:57:46 CEST 2009


vlc | branch: master | Rémi Duraffort <ivoire at videolan.org> | Thu Oct  8 16:41:41 2009 +0200| [160324c6dbb321655e6f31fb62383b2706095635] | committer: Rémi Duraffort 

lua: fix potential memleak.

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

 modules/misc/lua/intf.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/modules/misc/lua/intf.c b/modules/misc/lua/intf.c
index 7139264..ddcaf15 100644
--- a/modules/misc/lua/intf.c
+++ b/modules/misc/lua/intf.c
@@ -224,11 +224,19 @@ int Open_LuaIntf( vlc_object_t *p_this )
     if( asprintf( &psz_command,
                   "package.path = \"%s"DIR_SEP"modules"DIR_SEP"?.lua;\"..package.path",
                   p_sys->psz_filename ) < 0 )
+    {
+        free( psz_name );
+        free( p_sys );
         return VLC_EGENERIC;
+    }
     *psz_char = DIR_SEP_CHAR;
     if( luaL_dostring( L, psz_command ) )
+    {
+        free( psz_name );
+        free( p_sys );
         return VLC_EGENERIC;
     }
+    }
     /* </gruik> */
 
     psz_config = var_CreateGetString( p_intf, "lua-config" );




More information about the vlc-devel mailing list