This memory leak can be reproduced using a tight loop to uci:get() a config.
lua -e 'require("posix"); require("uci");
function getconf()
local tmp, uc = uci.cursor();
tmp = uc:get("system", "ntp", "enable_server");
end;
while 1
do
for i=0,1000 do getconf() end;
print("gc");
print(collectgarbage("count"));
collectgarbage();
print(collectgarbage("count"));
print("sleep 1");
posix.sleep(1);
end'
err = UCI_ERR_INVAL;
goto error;
}
err = UCI_ERR_INVAL;
goto error;
}
return uci_push_status(L, ctx, false);
}
return uci_push_status(L, ctx, false);
}
return uci_push_status(L, ctx, false);
}
return uci_push_status(L, ctx, false);
}
return uci_push_status(L, ctx, false);
}
return uci_push_status(L, ctx, false);
}
return uci_push_status(L, ctx, false);
}
return uci_push_status(L, ctx, false);
}