Commit 80660f17 authored by Antoine Cellerier's avatar Antoine Cellerier

Fix candidate filename leak in lua playlist.

parent 15071afc
...@@ -141,7 +141,7 @@ static int probe_luascript( vlc_object_t *p_this, const char * psz_filename, ...@@ -141,7 +141,7 @@ static int probe_luascript( vlc_object_t *p_this, const char * psz_filename,
msg_Warn( p_demux, "Error loading script %s: %s", psz_filename, msg_Warn( p_demux, "Error loading script %s: %s", psz_filename,
lua_tostring( L, lua_gettop( L ) ) ); lua_tostring( L, lua_gettop( L ) ) );
lua_pop( L, 1 ); lua_pop( L, 1 );
return VLC_EGENERIC; goto error;
} }
lua_getglobal( L, "probe" ); lua_getglobal( L, "probe" );
...@@ -151,6 +151,7 @@ static int probe_luascript( vlc_object_t *p_this, const char * psz_filename, ...@@ -151,6 +151,7 @@ static int probe_luascript( vlc_object_t *p_this, const char * psz_filename,
msg_Warn( p_demux, "Error while runing script %s, " msg_Warn( p_demux, "Error while runing script %s, "
"function probe() not found", psz_filename ); "function probe() not found", psz_filename );
lua_pop( L, 1 ); lua_pop( L, 1 );
goto error;
return VLC_EGENERIC; return VLC_EGENERIC;
} }
...@@ -160,22 +161,24 @@ static int probe_luascript( vlc_object_t *p_this, const char * psz_filename, ...@@ -160,22 +161,24 @@ static int probe_luascript( vlc_object_t *p_this, const char * psz_filename,
"function probe(): %s", psz_filename, "function probe(): %s", psz_filename,
lua_tostring( L, lua_gettop( L ) ) ); lua_tostring( L, lua_gettop( L ) ) );
lua_pop( L, 1 ); lua_pop( L, 1 );
goto error;
return VLC_EGENERIC; return VLC_EGENERIC;
} }
if( lua_gettop( L ) ) if( lua_gettop( L ) )
{ {
int i_ret = VLC_EGENERIC;
if( lua_toboolean( L, 1 ) ) if( lua_toboolean( L, 1 ) )
{ {
msg_Dbg( p_demux, "Lua playlist script %s's " msg_Dbg( p_demux, "Lua playlist script %s's "
"probe() function was successful", psz_filename ); "probe() function was successful", psz_filename );
i_ret = VLC_SUCCESS; lua_pop( L, 1 );
return VLC_SUCCESS;
} }
lua_pop( L, 1 ); lua_pop( L, 1 );
return i_ret;
} }
error:
FREENULL( p_sys->psz_filename );
return VLC_EGENERIC; return VLC_EGENERIC;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment