build: fix memory leaks

This commit is contained in:
Ali Chraghi 2022-08-27 12:40:03 +04:30 committed by Stephen Gutekanst
parent f094a85a1e
commit b9e00fdbb6
6 changed files with 113 additions and 65 deletions

View file

@ -194,6 +194,7 @@ fn thisDir() []const u8 {
fn ensureDependencySubmodule(allocator: std.mem.Allocator, path: []const u8) !void {
if (std.process.getEnvVarOwned(allocator, "NO_ENSURE_SUBMODULES")) |no_ensure_submodules| {
defer allocator.free(no_ensure_submodules);
if (std.mem.eql(u8, no_ensure_submodules, "true")) return;
} else |_| {}
var child = std.ChildProcess.init(&.{ "git", "submodule", "update", "--init", path }, allocator);