/** @file\r
*\r
-* Copyright (c) 2011, ARM Limited. All rights reserved.\r
+* Copyright (c) 2011-2012, ARM Limited. All rights reserved.\r
* \r
* This program and the accompanying materials \r
* are licensed and made available under the terms and conditions of the BSD License \r
gST->StdErr = gST->ConOut;\r
}\r
\r
+ // Free Memory allocated for reading the UEFI Variables\r
+ if (ConOutDevicePaths) {\r
+ FreePool (ConOutDevicePaths);\r
+ }\r
+ if (ConInDevicePaths) {\r
+ FreePool (ConInDevicePaths);\r
+ }\r
+ if (ConErrDevicePaths) {\r
+ FreePool (ConErrDevicePaths);\r
+ }\r
+\r
return EFI_SUCCESS;\r
}\r
\r
}\r
// In case of success, we should not return from this call.\r
}\r
+ FreePool (BootOrder);\r
}\r
}\r
return EFI_SUCCESS;\r
/** @file\r
*\r
-* Copyright (c) 2011, ARM Limited. All rights reserved.\r
+* Copyright (c) 2011-2012, ARM Limited. All rights reserved.\r
*\r
* This program and the accompanying materials\r
* are licensed and made available under the terms and conditions of the BSD License\r
Initrd, // Initrd\r
(CHAR8*)(LinuxArguments + 1),\r
FdtDevicePath);\r
+\r
+ FreePool (FdtDevicePath);\r
}\r
} else {\r
Status = BdsStartEfiApplication (mImageHandle, BootOption->FilePathList, BootOption->OptionalDataSize, BootOption->OptionalData);\r
}\r
}\r
\r
+ FreePool (BootOrder);\r
+\r
return EFI_SUCCESS;\r
}\r
\r
BootOrder\r
);\r
\r
+ // We only free it if the UEFI Variable 'BootOrder' was already existing\r
+ if (BootOrderSize > sizeof(UINT16)) {\r
+ FreePool (BootOrder);\r
+ }\r
+\r
*BdsLoadOption = BootOption;\r
return Status;\r
}\r
);\r
}\r
\r
+ FreePool (BootOrder);\r
+\r
return EFI_SUCCESS;\r
}\r