fix(config): fix a memory leak when the InvalidModule error occurs

This commit is contained in:
utox39
2025-10-04 17:55:50 +02:00
parent 20f9c6e1d5
commit 16bb74c47b

View File

@@ -51,6 +51,7 @@ pub fn getModulesTypes(allocator: std.mem.Allocator, config: ?std.json.Parsed(Co
if (module_enum) |m| { if (module_enum) |m| {
try modules_list.append(m); try modules_list.append(m);
} else { } else {
modules_list.deinit();
return error.InvalidModule; return error.InvalidModule;
} }
} }