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>
This commit is contained in:
Thomas Palmer 2018-07-03 23:32:53 +08:00 committed by Star Zeng
parent b5bd3ed648
commit 07eba7069d
1 changed files with 5 additions and 0 deletions

View File

@ -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);
}