diff options
author | lzeng14 <lzeng14@6f19259b-4bc3-4df7-8a09-765794883524> | 2012-06-18 01:34:27 +0000 |
---|---|---|
committer | lzeng14 <lzeng14@6f19259b-4bc3-4df7-8a09-765794883524> | 2012-06-18 01:34:27 +0000 |
commit | d69a7bc71207e4e607cfbde652d63adad7c0bd2d (patch) | |
tree | 9fe101b55d6762911c567aa62e682b592331d916 /MdeModulePkg/Universal/Acpi | |
parent | a7a8363d86ec8ad445fb73619b1ca5cac4e56a86 (diff) | |
download | edk2-d69a7bc71207e4e607cfbde652d63adad7c0bd2d.zip edk2-d69a7bc71207e4e607cfbde652d63adad7c0bd2d.tar.gz edk2-d69a7bc71207e4e607cfbde652d63adad7c0bd2d.tar.bz2 |
Fix potential memory leak issue.
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13458 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg/Universal/Acpi')
-rw-r--r-- | MdeModulePkg/Universal/Acpi/FirmwarePerformanceDataTableSmm/FirmwarePerformanceSmm.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/MdeModulePkg/Universal/Acpi/FirmwarePerformanceDataTableSmm/FirmwarePerformanceSmm.c b/MdeModulePkg/Universal/Acpi/FirmwarePerformanceDataTableSmm/FirmwarePerformanceSmm.c index 6de22d4..771c7f9 100644 --- a/MdeModulePkg/Universal/Acpi/FirmwarePerformanceDataTableSmm/FirmwarePerformanceSmm.c +++ b/MdeModulePkg/Universal/Acpi/FirmwarePerformanceDataTableSmm/FirmwarePerformanceSmm.c @@ -101,14 +101,15 @@ FpdtStatusCodeListenerSmm ( // Try to allocate big SMRAM data to store Boot record.
//
if (mSmramIsOutOfResource) {
+ ReleaseSpinLock (&mSmmFpdtLock);
return EFI_OUT_OF_RESOURCES;
}
- NewRecordBuffer = AllocatePool (mBootRecordSize + Data->Size + EXTENSION_RECORD_SIZE);
+ NewRecordBuffer = ReallocatePool (mBootRecordSize, mBootRecordSize + Data->Size + EXTENSION_RECORD_SIZE, mBootRecordBuffer);
if (NewRecordBuffer == NULL) {
+ ReleaseSpinLock (&mSmmFpdtLock);
mSmramIsOutOfResource = TRUE;
return EFI_OUT_OF_RESOURCES;
}
- CopyMem (NewRecordBuffer, mBootRecordBuffer, mBootRecordSize);
mBootRecordBuffer = NewRecordBuffer;
mBootRecordMaxSize = mBootRecordSize + Data->Size + EXTENSION_RECORD_SIZE;
}
|