From 74caaad028c72a3c9a33d113ea11f06a05cfcf28 Mon Sep 17 00:00:00 2001 From: ocbuild Date: Thu, 13 Jan 2022 16:40:41 +0300 Subject: [PATCH] Svace: Fixed MEMORY_LEAK.EX warning. --- MdeModulePkg/Bus/Pci/PciSioSerialDxe/Serial.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/MdeModulePkg/Bus/Pci/PciSioSerialDxe/Serial.c b/MdeModulePkg/Bus/Pci/PciSioSerialDxe/Serial.c index 9fe8a482e0..b7ecdf064d 100644 --- a/MdeModulePkg/Bus/Pci/PciSioSerialDxe/Serial.c +++ b/MdeModulePkg/Bus/Pci/PciSioSerialDxe/Serial.c @@ -864,6 +864,10 @@ SerialControllerDriverStart ( // If the SerialIo instance is already created, NULL as RemainingDevicePath is treated // as to create the same SerialIo instance. // + if (SerialDevices != NULL) { + FreePool (SerialDevices); + } + return EFI_SUCCESS; } else { //