Browse Source

Fix leaking temporary files and remove when done

pull/21/head
James Mills 4 weeks ago
parent
commit
5bbe534e6f
Signed by: prologic GPG Key ID: AC4C014F1440EBD6
  1. 1
      utils.go

1
utils.go

@ -97,6 +97,7 @@ func DownloadImage(conf *Config, url string, filename string, opts *ImageOptions
return err
}
defer tf.Close()
defer os.Remove(tf.Name())
if _, err := io.Copy(tf, res.Body); err != nil {
log.WithError(err).Error("error writng temporary file")

Loading…
Cancel
Save