case CMD_TRIGGERMENU:
{
int *pi = malloc( sizeof( int ) );
- if( !pi ) return VLC_ENOMEM;
+ if( !pi )
+ {
+ free( cmd );
+ vlc_mutex_unlock( &p_ext->p_sys->command_lock );
+ return VLC_ENOMEM;
+ }
*pi = va_arg( args, int );
cmd->data[0] = pi;
}
lua_getglobal( L, "vlc" );
lua_getfield( L, -1, "__dialog" );
if( lua_topointer( L, lua_gettop( L ) ) != NULL )
+ {
+ free( p_dlg );
return luaL_error( L, "Only one dialog allowed per extension!" );
+ }
p_dlg->p_object = p_this;
p_dlg->psz_title = strdup( psz_title );