-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Closed
Description
Description
Hello!
During the static analysis was found possible mistake:
- The handle '(*net/http.Client).Do(hrs.client, req).Body' is created at http_reader.go:183 by calling function 'http.Client.Do' and lost at http_reader.go:193.
resp, err := hrs.client.Do(req)
if err != nil {
return nil, err
}
// Normally would use client.SuccessStatus, but that would be a cyclic
// import
if resp.StatusCode >= 200 && resp.StatusCode <= 399 {
if hrs.readerOffset > 0 {
if resp.StatusCode != http.StatusPartialContent {
return nil, ErrWrongCodeForByteRange
}
Reproduce
Possible execution function reader()
Expected behavior
Possible handle leak
registry version
v2.8.3
Additional Info
No response
Metadata
Metadata
Assignees
Labels
No labels