Skip to content

Conversation

@maximevtush
Copy link

Summary

Fixes a resource leak in op-alt-da/daclient.go by ensuring HTTP response bodies are properly closed in all error scenarios.

Problem

The GetInput method in DAClient was not closing HTTP response bodies when returning early due to error status codes (404, non-200). This can lead to:

  • Resource leaks and file descriptor exhaustion
  • Performance degradation due to inability to reuse connections
  • Potential connection pool exhaustion under load

Solution

Moved defer resp.Body.Close() immediately after the client.Do(req) call to guarantee response body closure in all execution paths, including error cases.

@maximevtush maximevtush requested review from a team as code owners October 20, 2025 19:15
@maximevtush maximevtush requested a review from geoknee October 20, 2025 19:15
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.

1 participant