[vlc-devel] commit: Lua SD: don't fail the whole probe if a script fail ( Fabio Ritrovato )
git version control
git at videolan.org
Tue Feb 23 14:32:54 CET 2010
vlc | branch: master | Fabio Ritrovato <sephiroth87 at videolan.org> | Tue Feb 23 14:32:32 2010 +0100| [08b59679d090775824f786933f5c6d661d36cbe2] | committer: Fabio Ritrovato
Lua SD: don't fail the whole probe if a script fail
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=08b59679d090775824f786933f5c6d661d36cbe2
---
modules/misc/lua/vlc.c | 8 ++++++--
1 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/modules/misc/lua/vlc.c b/modules/misc/lua/vlc.c
index 181acd2..9bf2bab 100644
--- a/modules/misc/lua/vlc.c
+++ b/modules/misc/lua/vlc.c
@@ -619,13 +619,15 @@ static int vlc_sd_probe_Open( vlc_object_t *obj )
if( !L )
{
msg_Err( probe, "Could not create new Lua State" );
- return VLC_EGENERIC;
+ free( psz_filename );
+ goto error;
}
luaL_openlibs( L );
if( vlclua_add_modules_path( probe, L, psz_filename ) )
{
msg_Err( probe, "Error while setting the module search path for %s",
psz_filename );
+ free( psz_filename );
goto error;
}
if( luaL_dofile( L, psz_filename ) )
@@ -634,7 +636,9 @@ static int vlc_sd_probe_Open( vlc_object_t *obj )
msg_Err( probe, "Error loading script %s: %s", psz_filename,
lua_tostring( L, lua_gettop( L ) ) );
lua_pop( L, 1 );
- goto error;
+ free( psz_filename );
+ lua_close( L );
+ continue;
}
char *psz_longname;
char *temp = strchr( *ppsz_file, '.' );
More information about the vlc-devel
mailing list