mirror of https://github.com/valkey-io/valkey
Initialize the lua attributes of the luaFunction script (#2750)
This was introduced in #1826. This create an `Uninitialised value was
created by a heap allocation` in the CI.
Signed-off-by: Binbin <binloveplay1314@qq.com>
(cherry picked from commit 5d3cb3d04c)
Signed-off-by: cherukum-amazon <cherukum@amazon.com>
This commit is contained in:
parent
c87e47ed81
commit
28cf7ba66a
|
|
@ -275,6 +275,7 @@ static int luaRegisterFunctionReadNamedArgs(lua_State *lua,
|
|||
int lua_function_ref = luaL_ref(lua, LUA_REGISTRYINDEX);
|
||||
|
||||
script = zmalloc(sizeof(*script));
|
||||
script->lua = lua;
|
||||
script->function_ref = lua_function_ref;
|
||||
continue; /* value was already popped, so no need to pop it out. */
|
||||
} else if (!strcasecmp(key, "flags")) {
|
||||
|
|
@ -341,6 +342,7 @@ static int luaRegisterFunctionReadPositionalArgs(lua_State *lua,
|
|||
int lua_function_ref = luaL_ref(lua, LUA_REGISTRYINDEX);
|
||||
|
||||
script = zmalloc(sizeof(*script));
|
||||
script->lua = lua;
|
||||
script->function_ref = lua_function_ref;
|
||||
|
||||
luaRegisterFunctionArgsInitialize(func, name, NULL, script, 0);
|
||||
|
|
|
|||
Loading…
Reference in New Issue