attribute cleanup (auto_free) gets called when variable goes out of
scope, not on longjmp (in lua_error), so the variable never gets freed
lua_error(L);
}
/* Parse precedence declaration */
- auto_free char *declaration = strdup(lua_tostring(L, 1));
+ char *declaration = strdup(lua_tostring(L, 1));
if (!declaration) {
return kr_error(ENOMEM);
}
/* Load engine module */
struct engine *engine = engine_luaget(L);
int ret = engine_register(engine, name, precedence, ref);
+ free(declaration);
if (ret != 0) {
if (ret == kr_error(EIDRM)) {
format_error(L, "referenced module not found");