diff --git a/modules/misc/lua/intf.c b/modules/misc/lua/intf.c index 2207cc79977eb85c17c273cc2f9582e817a9dccf..f9f0dce264ac17711cb5c3174efaf9c3649884f5 100644 --- a/modules/misc/lua/intf.c +++ b/modules/misc/lua/intf.c @@ -177,6 +177,7 @@ int Open_LuaIntf( vlc_object_t *p_this ) if( !L ) { msg_Err( p_intf, "Could not create new Lua State" ); + free( p_sys->psz_filename ); free( psz_name ); free( p_sys ); return VLC_EGENERIC; @@ -225,6 +226,7 @@ int Open_LuaIntf( vlc_object_t *p_this ) "package.path = \"%s"DIR_SEP"modules"DIR_SEP"?.lua;\"..package.path", p_sys->psz_filename ) < 0 ) { + free( p_sys->psz_filename ); free( psz_name ); free( p_sys ); return VLC_EGENERIC; @@ -232,10 +234,13 @@ int Open_LuaIntf( vlc_object_t *p_this ) *psz_char = DIR_SEP_CHAR; if( luaL_dostring( L, psz_command ) ) { + free( psz_command ); + free( p_sys->psz_filename ); free( psz_name ); free( p_sys ); return VLC_EGENERIC; } + free( psz_command ); } /* */ @@ -305,6 +310,8 @@ void Close_LuaIntf( vlc_object_t *p_this ) vlc_mutex_destroy( &p_sys->lock ); lua_close( p_sys->L ); + + free( p_sys->psz_filename ); free( p_sys ); }