Skip to content

Commit 5d3cb3d

Browse files
authored
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 <[email protected]>
1 parent 2a914aa commit 5d3cb3d

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/lua/function_lua.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,7 @@ static int luaRegisterFunctionReadNamedArgs(lua_State *lua,
275275
int lua_function_ref = luaL_ref(lua, LUA_REGISTRYINDEX);
276276

277277
script = zmalloc(sizeof(*script));
278+
script->lua = lua;
278279
script->function_ref = lua_function_ref;
279280
continue; /* value was already popped, so no need to pop it out. */
280281
} else if (!strcasecmp(key, "flags")) {
@@ -341,6 +342,7 @@ static int luaRegisterFunctionReadPositionalArgs(lua_State *lua,
341342
int lua_function_ref = luaL_ref(lua, LUA_REGISTRYINDEX);
342343

343344
script = zmalloc(sizeof(*script));
345+
script->lua = lua;
344346
script->function_ref = lua_function_ref;
345347

346348
luaRegisterFunctionArgsInitialize(func, name, NULL, script, 0);

0 commit comments

Comments
 (0)