mirror of
https://github.com/wesnoth/wesnoth
synced 2025-05-05 22:41:15 +00:00
Fix a goto jumping past va_end
Found by coverity
This commit is contained in:
parent
e76a18d0f2
commit
8748b68b87
@ -372,13 +372,14 @@ bool luaW_getglobal(lua_State *L, ...)
|
||||
lua_rawget(L, -2);
|
||||
lua_remove(L, -2);
|
||||
}
|
||||
va_end(ap);
|
||||
|
||||
if (lua_isnil(L, -1)) {
|
||||
discard:
|
||||
va_end(ap);
|
||||
lua_pop(L, 1);
|
||||
return false;
|
||||
}
|
||||
va_end(ap);
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -415,4 +416,4 @@ unit *luaW_checkunit(lua_State *L, int index, bool only_on_map)
|
||||
unit *u = luaW_tounit(L, index, only_on_map);
|
||||
if (!u) luaL_typerror(L, index, "unit");
|
||||
return u;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user