Skip to content
This repository has been archived by the owner on Mar 16, 2024. It is now read-only.

Commit

Permalink
fix memory leak
Browse files Browse the repository at this point in the history
close old resp.Body before request new token
  • Loading branch information
vvnotw authored Sep 9, 2019
1 parent 47ecf50 commit 9c75c3e
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions registry/tokentransport.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ func (t *TokenTransport) RoundTrip(req *http.Request) (*http.Response, error) {
return resp, err
}
if authService := isTokenDemand(resp); authService != nil {
resp.Body.Close()
resp, err = t.authAndRetry(authService, req)
}
return resp, err
Expand Down

0 comments on commit 9c75c3e

Please sign in to comment.