Skip to content

Commit 7b17268

Browse files
wzshimingthaJeztah
authored andcommitted
remotes/docker/pusher.go: Fix missing Close()
Signed-off-by: Shiming Zhang <[email protected]> (cherry picked from commit 53ec1ab) Signed-off-by: Sebastiaan van Stijn <[email protected]>
1 parent 2f11d58 commit 7b17268

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

remotes/docker/pusher.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,13 +143,16 @@ func (p dockerPusher) push(ctx context.Context, desc ocispec.Descriptor, ref str
143143
// TODO: Set updated time?
144144
},
145145
})
146+
resp.Body.Close()
146147
return nil, errors.Wrapf(errdefs.ErrAlreadyExists, "content %v on remote", desc.Digest)
147148
}
148149
} else if resp.StatusCode != http.StatusNotFound {
149150
err := remoteserrors.NewUnexpectedStatusErr(resp)
150151
log.G(ctx).WithField("resp", resp).WithField("body", string(err.(remoteserrors.ErrUnexpectedStatus).Body)).Debug("unexpected response")
152+
resp.Body.Close()
151153
return nil, err
152154
}
155+
resp.Body.Close()
153156
}
154157

155158
if isManifest {

0 commit comments

Comments
 (0)