Skip to content

fix(mcp-client): add child.deinit() in spawn error path#172

Merged
gHashTag merged 1 commit into
mainfrom
feat/issue-166
Mar 11, 2026
Merged

fix(mcp-client): add child.deinit() in spawn error path#172
gHashTag merged 1 commit into
mainfrom
feat/issue-166

Conversation

@gHashTag
Copy link
Copy Markdown
Owner

Summary

  • Fix resource leak in src/tri-api/mcp_client.zig where child.deinit() was not called when child.spawn() failed
  • Added child.deinit() before the early return in the spawn error path (line 60)

Changes

  • src/tri-api/mcp_client.zig: Added child.deinit() call in the spawn error handler

Test Plan

  • zig fmt src/tri-api/mcp_client.zig passes (syntax valid)
  • zig ast-check src/tri-api/mcp_client.zig passes
  • Code change follows Zig memory management pattern (explicit cleanup on error)

Closes #166

🤖 Generated with Claude Code

When child.spawn() fails, the child process resources were leaking.
Added child.deinit() call before the early return to properly clean up.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@gHashTag gHashTag merged commit 9b1a928 into main Mar 11, 2026
4 of 6 checks passed
gHashTag pushed a commit that referenced this pull request Mar 11, 2026
…ig 0.15.2

PRs #171 and #172 added child.deinit() calls, but std.process.Child
doesn't have a deinit method. Builds locally due to lazy evaluation
but fails CI when tri-api is compiled.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
gHashTag added a commit that referenced this pull request Mar 18, 2026
fix(mcp-client): add child.deinit() in spawn error path
gHashTag pushed a commit that referenced this pull request Mar 18, 2026
…ig 0.15.2

PRs #171 and #172 added child.deinit() calls, but std.process.Child
doesn't have a deinit method. Builds locally due to lazy evaluation
but fails CI when tri-api is compiled.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@gHashTag gHashTag deleted the feat/issue-166 branch April 3, 2026 10:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(mcp-client): add child.deinit() in spawn error path in mcp_client.zig

1 participant