Merge pull request #20 from utox39/fix/invalid-module-memory-leak
Fix a memory leak when the InvalidModule error occurs
This commit is contained in:
@@ -10,7 +10,7 @@
|
||||
|
||||
// This is a [Semantic Version](https://semver.org/).
|
||||
// In a future version of Zig it will be used for package deduplication.
|
||||
.version = "0.22.0",
|
||||
.version = "0.22.1",
|
||||
|
||||
// Together with name, this represents a globally unique package
|
||||
// identifier. This field is generated by the Zig toolchain when the
|
||||
|
||||
@@ -51,6 +51,7 @@ pub fn getModulesTypes(allocator: std.mem.Allocator, config: ?std.json.Parsed(Co
|
||||
if (module_enum) |m| {
|
||||
try modules_list.append(m);
|
||||
} else {
|
||||
modules_list.deinit();
|
||||
return error.InvalidModule;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user