Skip to content

Commit

Permalink
fix: close res body (projectdiscovery#374)
Browse files Browse the repository at this point in the history
  • Loading branch information
testwill authored Jul 26, 2024
1 parent ce2e6e0 commit 328cc3d
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions pkg/utils/httpreq/httpreq.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ func (c *Client) Get(url string, response interface{}) error {
if err != nil {
return fmt.Errorf("error creating request: %v", err)
}
defer res.Body.Close()
if err := jsoniter.NewDecoder(res.Body).Decode(&response); err != nil {
return fmt.Errorf("error trying to unmarshal the response: %v", err)
}
Expand Down

0 comments on commit 328cc3d

Please sign in to comment.