diff --git a/src/util/funcs.zig b/src/util/funcs.zig index c7910f3ca4f9fd33079f5254a16711ef0369cd2f..ff4e269925c9bd516178399c3fdf4f2deef2cbac 100644 --- a/src/util/funcs.zig +++ b/src/util/funcs.zig @@ -158,13 +158,15 @@ pub fn file_list(dpath: []const u8, list: *std.ArrayList([]const u8)) !void { } pub fn run_cmd(dir: ?[]const u8, args: []const []const u8) !u32 { - const result = std.ChildProcess.exec(.{ .allocator = gpa, .cwd = dir, .argv = args, }) catch |e| switch(e) { + const result = std.ChildProcess.exec(.{ .allocator = gpa, .cwd = dir, .argv = args, .max_output_bytes = std.math.maxInt(usize) }) catch |e| switch(e) { error.FileNotFound => { u.assert(false, "\"{s}\" command not found", .{args[0]}); unreachable; }, else => return e, }; + gpa.free(result.stdout); + gpa.free(result.stderr); return result.term.Exited; }