Fix leaking temporary files and remove when done
continuous-integration/drone/push Build is passing Details

pull/21/head
James Mills 1 year ago
parent da331c11fe
commit 5bbe534e6f
Signed by: prologic
GPG Key ID: AC4C014F1440EBD6

@ -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