\r
DevicePath = Multi;\r
DevicePathInst = GetNextDevicePathInstance (&DevicePath, &Size);\r
- Size -= sizeof (EFI_DEVICE_PATH_PROTOCOL);\r
\r
//\r
// Search for the match of 'Single' in 'Multi'\r
// If the single device path is found in multiple device paths,\r
// return success\r
//\r
- if (Size == 0) {\r
- return FALSE;\r
- }\r
-\r
if (CompareMem (Single, DevicePathInst, Size) == 0) {\r
+ gBS->FreePool (DevicePathInst);\r
return TRUE;\r
}\r
\r
gBS->FreePool (DevicePathInst);\r
DevicePathInst = GetNextDevicePathInstance (&DevicePath, &Size);\r
- Size -= sizeof (EFI_DEVICE_PATH_PROTOCOL);\r
}\r
\r
return FALSE;\r