Skip to content

Commit

Permalink
Merge pull request #1 from bluntik/699-fix-memory-leak
Browse files Browse the repository at this point in the history
Fix memoty leak(cloudevents#699)
  • Loading branch information
bluntik authored Aug 5, 2021
2 parents 49fda7a + a0b037b commit c320720
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions v2/protocol/http/protocol_retry.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@ func (p *Protocol) do(ctx context.Context, req *http.Request) (binding.Message,

func (p *Protocol) doOnce(req *http.Request) (binding.Message, protocol.Result) {
resp, err := p.Client.Do(req)

if resp != nil {
defer resp.Body.Close()
}

if err != nil {
return nil, protocol.NewReceipt(false, "%w", err)
}
Expand Down

0 comments on commit c320720

Please sign in to comment.