Skip to content

Commit

Permalink
Ensure tmpFile is closed before attempting to clean it up
Browse files Browse the repository at this point in the history
  • Loading branch information
idoru authored and mrosecrance committed Oct 15, 2020
1 parent cb640e2 commit 4703629
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions cmd/downloader.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ func (d UIDownloader) Download(blobstoreID, sha1, prefix, dstDirPath string) err
return err
}

defer tmpFile.Close()
defer d.fs.RemoveAll(tmpFile.Name())

d.ui.PrintLinef("Downloading resource '%s' to '%s'...", blobstoreID, dstFilePath)
Expand Down

0 comments on commit 4703629

Please sign in to comment.