Skip to content

Commit

Permalink
Merge pull request #50 from hallyn/2023-10-26/fileleak
Browse files Browse the repository at this point in the history
Delete /tmp/setvendordb file when done
  • Loading branch information
hallyn authored Oct 28, 2023
2 parents 584f3a4 + e0d57ca commit 0b9a8e5
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions go/pkg/shim/shim.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"fmt"
"io"
"io/ioutil"
"os"
"unsafe"

efi "github.com/canonical/go-efilib"
Expand Down Expand Up @@ -73,8 +74,10 @@ func SetVendorDB(shim string, db, dbx efi.SignatureDatabase) error {
if err != nil {
return err
}
defer os.Remove(fp.Name())

if err := VendorDBSectionWrite(fp, db, dbx); err != nil {
fp.Close()
return err
}

Expand Down

0 comments on commit 0b9a8e5

Please sign in to comment.