From fadf4f377e86aebf64bfc0c57cdcfe5e70f04443 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 687497278c95..52e2322c1a26 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; }