Audit get_variable() calls for correct FreePool() use.

Signed-off-by: Peter Jones <pjones@redhat.com>
This commit is contained in:
Peter Jones 2018-04-05 14:09:37 -04:00
parent 36cf41a616
commit 77ebb3d676
3 changed files with 10 additions and 3 deletions

View File

@ -1310,7 +1310,8 @@ static EFI_STATUS delete_keys(void *MokDel, UINTN MokDelSize, BOOLEAN MokX)
gRT->SetVariable(db_name, &SHIM_LOCK_GUID, gRT->SetVariable(db_name, &SHIM_LOCK_GUID,
EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_NON_VOLATILE |
EFI_VARIABLE_BOOTSERVICE_ACCESS, 0, NULL); EFI_VARIABLE_BOOTSERVICE_ACCESS, 0, NULL);
return EFI_ACCESS_DENIED; efi_status = EFI_ACCESS_DENIED;
goto error;
} }
/* Nothing to do */ /* Nothing to do */

View File

@ -33,14 +33,16 @@ get_fallback_verbose(void)
return state; return state;
} }
state = 0;
for (i = 0; i < dataSize; i++) { for (i = 0; i < dataSize; i++) {
if (data[i]) { if (data[i]) {
state = 1; state = 1;
return state; break;
} }
} }
state = 0; if (data)
FreePool(data);
return state; return state;
} }
@ -990,6 +992,8 @@ debug_hook(void)
return; return;
} }
if (data)
FreePool(data);
if (x) if (x)
return; return;

2
shim.c
View File

@ -2497,6 +2497,8 @@ debug_hook(void)
return; return;
} }
FreePool(data);
console_print(L"add-symbol-file "DEBUGDIR console_print(L"add-symbol-file "DEBUGDIR
L"shim" EFI_ARCH L".efi.debug 0x%08x -s .data 0x%08x\n", L"shim" EFI_ARCH L".efi.debug 0x%08x -s .data 0x%08x\n",
&_text, &_data); &_text, &_data);