public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH 1/1] MdeModulePkg/PciBusDxe: Fix small memory leak in FreePciDevice
@ 2018-07-03 15:32 Thomas Palmer
  2018-07-06  7:34 ` Zeng, Star
  2018-07-18  4:33 ` Ni, Ruiyu
  0 siblings, 2 replies; 5+ messages in thread
From: Thomas Palmer @ 2018-07-03 15:32 UTC (permalink / raw)
  To: edk2-devel
  Cc: eric.dong, star.zeng, ruiyu.ni, garyli, joseph.shifflett,
	Thomas Palmer

When cleaning the PciIoDevice, also free the BusNumberRange

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Thomas Palmer <thomas.palmer@hpe.com>
---
 MdeModulePkg/Bus/Pci/PciBusDxe/PciDeviceSupport.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/MdeModulePkg/Bus/Pci/PciBusDxe/PciDeviceSupport.c b/MdeModulePkg/Bus/Pci/PciBusDxe/PciDeviceSupport.c
index ad7a2337f578..48cf57a24f8f 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);
 }
 
-- 
2.7.4



^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2018-07-27  1:01 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-07-03 15:32 [PATCH 1/1] MdeModulePkg/PciBusDxe: Fix small memory leak in FreePciDevice Thomas Palmer
2018-07-06  7:34 ` Zeng, Star
2018-07-09 20:17   ` Palmer, Thomas
2018-07-18  4:33 ` Ni, Ruiyu
2018-07-27  1:01   ` Zeng, Star

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox