Skip to content

Commit

Permalink
fix: remove double close
Browse files Browse the repository at this point in the history
Signed-off-by: Christoph MEIER <meier-christoph@users.noreply.github.com>
  • Loading branch information
meier-christoph committed Feb 19, 2024
1 parent 45c9573 commit 728e3d4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/vendir/fetch/http/sync.go
Expand Up @@ -38,11 +38,11 @@ func (t *Sync) Sync(dstPath string, tempArea ctlfetch.TempArea) (ctlconf.LockDir
return lockConf, err
}

defer tmpFile.Close()
defer os.Remove(tmpFile.Name())

err = t.downloadFileAndChecksum(tmpFile)
if err != nil {
tmpFile.Close()
return lockConf, fmt.Errorf("Downloading URL: %s", err)
}

Expand Down

0 comments on commit 728e3d4

Please sign in to comment.