mirror of
https://git.proxmox.com/git/efi-boot-shim
synced 2025-05-30 21:37:40 +00:00
MokManager: Remove the unnecessary string duplication
This commit is contained in:
parent
d71240bfff
commit
8371c49ce7
19
MokManager.c
19
MokManager.c
@ -1448,45 +1448,45 @@ static EFI_STATUS enter_mok_menu(EFI_HANDLE image_handle,
|
|||||||
return EFI_OUT_OF_RESOURCES;
|
return EFI_OUT_OF_RESOURCES;
|
||||||
}
|
}
|
||||||
|
|
||||||
menu_strings[i] = StrDuplicate(L"Continue boot");
|
menu_strings[i] = L"Continue boot";
|
||||||
menu_item[i] = MOK_CONTINUE_BOOT;
|
menu_item[i] = MOK_CONTINUE_BOOT;
|
||||||
|
|
||||||
i++;
|
i++;
|
||||||
|
|
||||||
if (MokNew || MokAuth) {
|
if (MokNew || MokAuth) {
|
||||||
if (!MokNew) {
|
if (!MokNew) {
|
||||||
menu_strings[i] = StrDuplicate(L"Reset MOK");
|
menu_strings[i] = L"Reset MOK";
|
||||||
menu_item[i] = MOK_RESET_MOK;
|
menu_item[i] = MOK_RESET_MOK;
|
||||||
} else {
|
} else {
|
||||||
menu_strings[i] = StrDuplicate(L"Enroll MOK");
|
menu_strings[i] = L"Enroll MOK";
|
||||||
menu_item[i] = MOK_ENROLL_MOK;
|
menu_item[i] = MOK_ENROLL_MOK;
|
||||||
}
|
}
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (MokDel || MokDelAuth) {
|
if (MokDel || MokDelAuth) {
|
||||||
menu_strings[i] = StrDuplicate(L"Delete MOK");
|
menu_strings[i] = L"Delete MOK";
|
||||||
menu_item[i] = MOK_DELETE_MOK;
|
menu_item[i] = MOK_DELETE_MOK;
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (MokSB) {
|
if (MokSB) {
|
||||||
menu_strings[i] = StrDuplicate(L"Change Secure Boot state");
|
menu_strings[i] = L"Change Secure Boot state";
|
||||||
menu_item[i] = MOK_CHANGE_SB;
|
menu_item[i] = MOK_CHANGE_SB;
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (MokPW) {
|
if (MokPW) {
|
||||||
menu_strings[i] = StrDuplicate(L"Set MOK password");
|
menu_strings[i] = L"Set MOK password";
|
||||||
menu_item[i] = MOK_SET_PW;
|
menu_item[i] = MOK_SET_PW;
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
|
|
||||||
menu_strings[i] = StrDuplicate(L"Enroll key from disk");
|
menu_strings[i] = L"Enroll key from disk";
|
||||||
menu_item[i] = MOK_KEY_ENROLL;
|
menu_item[i] = MOK_KEY_ENROLL;
|
||||||
i++;
|
i++;
|
||||||
|
|
||||||
menu_strings[i] = StrDuplicate(L"Enroll hash from disk");
|
menu_strings[i] = L"Enroll hash from disk";
|
||||||
menu_item[i] = MOK_HASH_ENROLL;
|
menu_item[i] = MOK_HASH_ENROLL;
|
||||||
i++;
|
i++;
|
||||||
|
|
||||||
@ -1529,9 +1529,6 @@ static EFI_STATUS enter_mok_menu(EFI_HANDLE image_handle,
|
|||||||
out:
|
out:
|
||||||
console_reset();
|
console_reset();
|
||||||
|
|
||||||
for (i=0; menu_strings[i] != NULL; i++)
|
|
||||||
FreePool(menu_strings[i]);
|
|
||||||
|
|
||||||
FreePool(menu_strings);
|
FreePool(menu_strings);
|
||||||
|
|
||||||
if (menu_item)
|
if (menu_item)
|
||||||
|
Loading…
Reference in New Issue
Block a user