Skip to content

Commit

Permalink
Delete /tmp/setvendordb file when done
Browse files Browse the repository at this point in the history
Hopefully we are in fact done with it after this function...  Right now every time I
create a keyset one of these files leaks.

Signed-off-by: Serge Hallyn <[email protected]>
  • Loading branch information
hallyn committed Oct 27, 2023
1 parent 584f3a4 commit e0d57ca
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 e0d57ca

Please sign in to comment.