fix mzte_nv resource leak

This commit is contained in:
LordMZTE 2022-10-19 00:09:16 +02:00
parent e38661a2af
commit 1cc31f80d8
Signed by: LordMZTE
GPG key ID: B64802DC33A64FF6

View file

@ -32,7 +32,8 @@ const runtime_map = [_]Runtime{
};
fn lFindRuntimes(l: *c.lua_State) !c_int {
const jvmdir = try std.fs.openIterableDirAbsolute("/usr/lib/jvm/", .{});
var jvmdir = try std.fs.openIterableDirAbsolute("/usr/lib/jvm/", .{});
defer jvmdir.close();
c.lua_newtable(l);
@ -47,7 +48,7 @@ fn lFindRuntimes(l: *c.lua_State) !c_int {
if (!std.mem.containsAtLeast(u8, jvm.name, 1, rt.version))
continue;
// push a table with a name field (must be a V from runtime_map)
// push a table with a name field (must be a name from runtime_map)
// and a path field (path to the runtime's home)
c.lua_newtable(l);