Skip to content

Commit

Permalink
close response body
Browse files Browse the repository at this point in the history
  • Loading branch information
house-lee committed Jun 12, 2024
1 parent 585b0a6 commit ddd6ef7
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions internal/metadata/updater/updater.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,11 @@ func (u *agentInfoUpdaterImpl) Update(md *metadata.Metadata) error {
if err != nil {
return fmt.Errorf("%w:%v", ErrUpdateMetadataFailed, err)
}
defer func() {
if resp.Body != nil {
resp.Body.Close()
}
}()

success := resp.StatusCode >= 200 && resp.StatusCode < 300
if !success {
Expand Down

0 comments on commit ddd6ef7

Please sign in to comment.