Skip to content

fix(state): add missing child.deinit() in tri_state.zig runProcessInherit #165

@gHashTag

Description

@gHashTag

Task

In src/tri/tri_state.zig lines 35-44, the runProcessInherit() function creates a std.process.Child but never calls deinit(). Process resources leak.

Current Code

pub fn runProcessInherit(allocator: std.mem.Allocator, argv: []const []const u8) !u8 {
    var child = std.process.Child.init(argv, allocator);
    child.stdout_behavior = .Inherit;
    child.stderr_behavior = .Inherit;
    _ = try child.spawn();
    const result = try child.wait();
    return switch (result) {
        .Exited => |c| c,
        else => 1,
    };
}

Fix

Add defer child.deinit(); after init:

var child = std.process.Child.init(argv, allocator);
defer child.deinit();

File

  • src/tri/tri_state.zig — lines 35-44

Acceptance

  • zig build compiles without errors
  • zig fmt passes
  • defer child.deinit() present after Child.init()

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent:spawnAuto-spawn agent container

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions