summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mok.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/mok.c b/mok.c
index 98a0a65a..bf71542b 100644
--- a/mok.c
+++ b/mok.c
@@ -604,7 +604,7 @@ mirror_mok_db(CHAR16 *name, EFI_GUID *guid, UINT32 attrs,
return efi_status;
}
- CHAR16 *namen;
+ CHAR16 *namen = NULL;
UINTN namelen, namesz;
namelen = StrLen(name);
@@ -726,6 +726,9 @@ mirror_mok_db(CHAR16 *name, EFI_GUID *guid, UINT32 attrs,
break;
i++;
}
+ if (namen && namen != name) {
+ FreePool(namen);
+ }
if (EFI_ERROR(efi_status)) {
perror(L"Failed to set %s: %r\n", name, efi_status);