From d8b676ff6d489457e1d509b5eed9f7d61d9020dd Mon Sep 17 00:00:00 2001 From: Michael D Kinney Date: Wed, 23 Oct 2024 18:45:41 -0700 Subject: [PATCH] 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 --- MdePkg/Test/UnitTest/Library/DevicePathLib/TestDevicePathLib.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/MdePkg/Test/UnitTest/Library/DevicePathLib/TestDevicePathLib.c b/MdePkg/Test/UnitTest/Library/DevicePathLib/TestDevicePathLib.c index 687497278c952..52e2322c1a26e 100644 --- a/MdePkg/Test/UnitTest/Library/DevicePathLib/TestDevicePathLib.c +++ b/MdePkg/Test/UnitTest/Library/DevicePathLib/TestDevicePathLib.c @@ -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; }