]> git.sesse.net Git - vlc/commitdiff
lua: fix potential memleak.
authorRémi Duraffort <ivoire@videolan.org>
Thu, 8 Oct 2009 14:41:41 +0000 (16:41 +0200)
committerRémi Duraffort <ivoire@videolan.org>
Sat, 10 Oct 2009 09:26:49 +0000 (11:26 +0200)
modules/misc/lua/intf.c

index 7139264671e345310708578fe310bf365cfdd86a..ddcaf1565e3567042ba3eb30abec85f1cd6610a4 100644 (file)
@@ -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" );