Skip to content

Commit

Permalink
MdePkg/Test/DevicePathLib: Remove FreePool(NULL)
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
mdkinney authored and mergify[bot] committed Nov 8, 2024
1 parent d5600f4 commit fadf4f3
Showing 1 changed file with 0 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -473,11 +473,9 @@ TestAppendDevicePathInstance (

Appended = AppendDevicePathInstance (NULL, NULL);
UT_ASSERT_EQUAL ((uintptr_t)Appended, (uintptr_t)NULL);
FreePool (Appended);

Appended = AppendDevicePathInstance ((EFI_DEVICE_PATH_PROTOCOL *)&mSimpleDevicePath, (EFI_DEVICE_PATH_PROTOCOL *)&mInvalidSimpleDevicePath);
UT_ASSERT_EQUAL ((uintptr_t)Appended, (uintptr_t)NULL);
FreePool (Appended);

return UNIT_TEST_PASSED;
}
Expand Down

0 comments on commit fadf4f3

Please sign in to comment.