Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Harry Liebel <Harry.Liebel@arm.com>
Reviewed-by: Olivier Martin <olivier.martin@arm.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15459
6f19259b-4bc3-4df7-8a09-
765794883524
\r
Size = sizeof(UINT16);\r
Timeout = (UINT16)PcdGet16 (PcdPlatformBootTimeOut);\r
- TimeoutPtr = &Timeout;\r
- GetGlobalEnvironmentVariable (L"Timeout", &Timeout, &Size, (VOID**)&TimeoutPtr);\r
+ Status = GetGlobalEnvironmentVariable (L"Timeout", &Timeout, &Size, (VOID**)&TimeoutPtr);\r
+ if (!EFI_ERROR (Status)) {\r
+ Timeout = *TimeoutPtr;\r
+ FreePool (TimeoutPtr);\r
+ }\r
\r
if (Timeout != 0xFFFF) {\r
if (Timeout > 0) {\r