Skip to content
Prev Previous commit
Fix resource leak: close response body in success path
Co-authored-by: SamMorrowDrums <4811358+SamMorrowDrums@users.noreply.github.com>
  • Loading branch information
Copilot and SamMorrowDrums committed Jan 20, 2026
commit 8e0a81fb76f7d8854f70c98f009f7745b1fc8f07
1 change: 1 addition & 0 deletions pkg/github/issues.go
Original file line number Diff line number Diff line change
Expand Up @@ -831,6 +831,7 @@ func AddSubIssue(ctx context.Context, client *github.Client, owner string, repo

// Success case
if err == nil && resp.StatusCode == http.StatusCreated {
_ = resp.Body.Close()
r, err := json.Marshal(subIssue)
if err != nil {
return nil, fmt.Errorf("failed to marshal response: %w", err)
Expand Down