From 13354807d4881376475c3dfa567df6b515aea9e0 Mon Sep 17 00:00:00 2001 From: Harry Liebel Date: Fri, 11 Apr 2014 15:57:06 +0000 Subject: ArmPlatformPkg/Bds: Fix loading Timeout from NV storage Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Harry Liebel Reviewed-by: Olivier Martin git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15459 6f19259b-4bc3-4df7-8a09-765794883524 --- ArmPlatformPkg/Bds/Bds.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'ArmPlatformPkg') diff --git a/ArmPlatformPkg/Bds/Bds.c b/ArmPlatformPkg/Bds/Bds.c index fa9dfbafc4..d2b62252ed 100644 --- a/ArmPlatformPkg/Bds/Bds.c +++ b/ArmPlatformPkg/Bds/Bds.c @@ -367,8 +367,11 @@ StartDefaultBootOnTimeout ( Size = sizeof(UINT16); Timeout = (UINT16)PcdGet16 (PcdPlatformBootTimeOut); - TimeoutPtr = &Timeout; - GetGlobalEnvironmentVariable (L"Timeout", &Timeout, &Size, (VOID**)&TimeoutPtr); + Status = GetGlobalEnvironmentVariable (L"Timeout", &Timeout, &Size, (VOID**)&TimeoutPtr); + if (!EFI_ERROR (Status)) { + Timeout = *TimeoutPtr; + FreePool (TimeoutPtr); + } if (Timeout != 0xFFFF) { if (Timeout > 0) { -- cgit v1.2.3