if (InitrdPathNodes != NULL) {\r
// Append the Device Path to the selected device path\r
InitrdPath = AppendDevicePath (SupportedBootDevice->DevicePathProtocol, (CONST EFI_DEVICE_PATH_PROTOCOL *)InitrdPathNodes);\r
+ // Free the InitrdPathNodes created by Support->CreateDevicePathNode()\r
+ FreePool (InitrdPathNodes);\r
+\r
if (InitrdPath == NULL) {\r
Status = EFI_OUT_OF_RESOURCES;\r
goto EXIT;\r
// Append the Device Path to the selected device path\r
InitrdPath = AppendDevicePath (TempInitrdPath, (CONST EFI_DEVICE_PATH_PROTOCOL *)InitrdPathNodes);\r
FreePool (TempInitrdPath);\r
+ // Free the InitrdPathNodes created by Support->CreateDevicePathNode()\r
+ FreePool (InitrdPathNodes);\r
if (InitrdPath == NULL) {\r
Status = EFI_OUT_OF_RESOURCES;\r
goto EXIT;\r
if (FdtDevicePathNodes != NULL) {\r
// Append the Device Path node to the select device path\r
FdtDevicePath = AppendDevicePath (SupportedBootDevice->DevicePathProtocol, FdtDevicePathNodes);\r
+ // Free the FdtDevicePathNodes created by Support->CreateDevicePathNode()\r
+ FreePool (FdtDevicePathNodes);\r
FdtDevicePathSize = GetDevicePathSize (FdtDevicePath);\r
Status = gRT->SetVariable (\r
(CHAR16*)L"Fdt",\r