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

Commit

Permalink
Merge pull request #1976 from daniel-garcia/fixBackupLeak
Browse files Browse the repository at this point in the history
close s3 reader after saving snapshot
  • Loading branch information
fanminshi authored Jul 6, 2018
2 parents c8f63d5 + eb6e6d5 commit 9152f09
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/backup/writer/s3_writer.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ func (s3w *s3Writer) Write(ctx context.Context, path string, r io.Reader) (int64
if err != nil {
return 0, err
}
if resp.Body != nil {
defer resp.Body.Close()
}
if resp.ContentLength == nil {
return 0, fmt.Errorf("failed to compute s3 object size")
}
Expand Down

0 comments on commit 9152f09

Please sign in to comment.