GRIM: Initialize Lua value even for Nil to avoid uninit values

In practice shouldn't matter, but just to avoid having
uninitialized values around, we should set the value-field,
even for Nil.

Fixes COVERITY: 1470689
This commit is contained in:
Einar Johan Trøan Sømåen 2022-10-02 01:16:36 +02:00
parent 1eb48aa90a
commit a18212b4d4
No known key found for this signature in database
GPG Key ID: 0DFF2FB496CF9F93

View File

@ -78,6 +78,8 @@ void LuaObjects::add(const char *str) {
void LuaObjects::addNil() {
Obj obj;
obj._type = Obj::Nil;
// Just set a value to avoid having uninitialized fields.
obj._value.object = nullptr;
_objects.push_back(obj);
}