]> git.sesse.net Git - vlc/commitdiff
Lua SD: don't fail the whole probe if a script fail
authorFabio Ritrovato <sephiroth87@videolan.org>
Tue, 23 Feb 2010 13:32:32 +0000 (14:32 +0100)
committerFabio Ritrovato <sephiroth87@videolan.org>
Tue, 23 Feb 2010 13:32:32 +0000 (14:32 +0100)
modules/misc/lua/vlc.c

index 181acd29748c8e8a448c73828788a7141a88b9a7..9bf2babdb81676b288076730c7a1dcb059dd5273 100644 (file)
@@ -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, '.' );