mirror of
https://github.com/acidanthera/audk.git
synced 2025-07-26 23:24:03 +02:00
MdePkg/Test/DevicePathLib: Remove FreePool(NULL)
Unit test checks if AppendDevicePathInstance() returns NULL. In those cases, AppendDevicePathInstance() does not allocate a device path, so the call to FreePool() must not be performed. Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
This commit is contained in:
parent
d5600f4f5a
commit
fadf4f377e
@ -473,11 +473,9 @@ TestAppendDevicePathInstance (
|
|||||||
|
|
||||||
Appended = AppendDevicePathInstance (NULL, NULL);
|
Appended = AppendDevicePathInstance (NULL, NULL);
|
||||||
UT_ASSERT_EQUAL ((uintptr_t)Appended, (uintptr_t)NULL);
|
UT_ASSERT_EQUAL ((uintptr_t)Appended, (uintptr_t)NULL);
|
||||||
FreePool (Appended);
|
|
||||||
|
|
||||||
Appended = AppendDevicePathInstance ((EFI_DEVICE_PATH_PROTOCOL *)&mSimpleDevicePath, (EFI_DEVICE_PATH_PROTOCOL *)&mInvalidSimpleDevicePath);
|
Appended = AppendDevicePathInstance ((EFI_DEVICE_PATH_PROTOCOL *)&mSimpleDevicePath, (EFI_DEVICE_PATH_PROTOCOL *)&mInvalidSimpleDevicePath);
|
||||||
UT_ASSERT_EQUAL ((uintptr_t)Appended, (uintptr_t)NULL);
|
UT_ASSERT_EQUAL ((uintptr_t)Appended, (uintptr_t)NULL);
|
||||||
FreePool (Appended);
|
|
||||||
|
|
||||||
return UNIT_TEST_PASSED;
|
return UNIT_TEST_PASSED;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user