lua: intf: refactor error path

Refactor error path behind a goto, including the release of the lua
state and lua interrupt.

No functional changes.
This commit is contained in:
Alexandre Janniaux 2023-02-19 12:05:25 +01:00 committed by Felix Paul Kühne
parent f22e34a2f2
commit c4ab75b891
1 changed files with 4 additions and 5 deletions

View File

@ -380,13 +380,12 @@ static int Start_LuaIntf( vlc_object_t *p_this, const char *name )
p_sys->L = L;
if( vlc_clone( &p_sys->thread, Run, p_intf ) )
{
vlclua_fd_cleanup( &p_sys->dtable );
lua_close( p_sys->L );
goto error;
}
goto error_lua;
free( namebuf );
return VLC_SUCCESS;
error_lua:
vlclua_fd_cleanup( &p_sys->dtable );
lua_close( p_sys->L );
error:
free( p_sys->psz_filename );
free( p_sys );