diff options
author | Thomas Palmer <thomas.palmer@hpe.com> | 2018-07-03 23:32:53 +0800 |
---|---|---|
committer | Star Zeng <star.zeng@intel.com> | 2018-07-27 08:59:31 +0800 |
commit | 07eba7069d4c23e9b15caa1e729682a88ddf4ada (patch) | |
tree | 224198e771d5db0c78355cb29556dcdd9c9a2c61 | |
parent | b5bd3ed64898db1088a9468446a0d2d0dc7185e8 (diff) | |
download | edk2-07eba7069d4c23e9b15caa1e729682a88ddf4ada.zip edk2-07eba7069d4c23e9b15caa1e729682a88ddf4ada.tar.gz edk2-07eba7069d4c23e9b15caa1e729682a88ddf4ada.tar.bz2 |
MdeModulePkg/PciBusDxe: Fix small memory leak in FreePciDevice
When cleaning the PciIoDevice, also free the BusNumberRange
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Thomas Palmer <thomas.palmer@hpe.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
-rw-r--r-- | MdeModulePkg/Bus/Pci/PciBusDxe/PciDeviceSupport.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/MdeModulePkg/Bus/Pci/PciBusDxe/PciDeviceSupport.c b/MdeModulePkg/Bus/Pci/PciBusDxe/PciDeviceSupport.c index ad7a233..48cf57a 100644 --- a/MdeModulePkg/Bus/Pci/PciBusDxe/PciDeviceSupport.c +++ b/MdeModulePkg/Bus/Pci/PciBusDxe/PciDeviceSupport.c @@ -2,6 +2,7 @@ Supporting functions implementaion for PCI devices management.
Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
+(C) Copyright 2018 Hewlett Packard Enterprise Development LP<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -105,6 +106,10 @@ FreePciDevice ( FreePool (PciIoDevice->DevicePath);
}
+ if (PciIoDevice->BusNumberRanges != NULL) {
+ FreePool (PciIoDevice->BusNumberRanges);
+ }
+
FreePool (PciIoDevice);
}
|