diff options
author | Mike Maslenkin <mike.maslenkin@gmail.com> | 2023-08-31 17:10:32 -0700 |
---|---|---|
committer | mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> | 2023-09-11 02:17:51 +0000 |
commit | cc26a2cb3162845bf51d41ea8cd1c438ffa6c50a (patch) | |
tree | 672635cfd206119e3e8a8b67c8f0b72c1360930e /MdeModulePkg | |
parent | f18ec60fa4e140fca22714632764d56b8d511fc8 (diff) | |
download | edk2-cc26a2cb3162845bf51d41ea8cd1c438ffa6c50a.zip edk2-cc26a2cb3162845bf51d41ea8cd1c438ffa6c50a.tar.gz edk2-cc26a2cb3162845bf51d41ea8cd1c438ffa6c50a.tar.bz2 |
MdeModulePkg/Core/Dxe: Fix memory leak issue in FwVolBlock.c
FvbDev->LbaCache must be freed on error path before freeing FvbDev.
Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Dandan Bi <dandan.bi@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Signed-off-by: Mike Maslenkin <mike.maslenkin@gmail.com>
Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
Diffstat (limited to 'MdeModulePkg')
-rw-r--r-- | MdeModulePkg/Core/Dxe/FwVolBlock/FwVolBlock.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/MdeModulePkg/Core/Dxe/FwVolBlock/FwVolBlock.c b/MdeModulePkg/Core/Dxe/FwVolBlock/FwVolBlock.c index d81334c..9f5f40e 100644 --- a/MdeModulePkg/Core/Dxe/FwVolBlock/FwVolBlock.c +++ b/MdeModulePkg/Core/Dxe/FwVolBlock/FwVolBlock.c @@ -551,6 +551,7 @@ ProduceFVBProtocolOnBuffer ( //
FvbDev->DevicePath = (EFI_DEVICE_PATH_PROTOCOL *)AllocateCopyPool (sizeof (FV_MEMMAP_DEVICE_PATH), &mFvMemmapDevicePathTemplate);
if (FvbDev->DevicePath == NULL) {
+ FreePool (FvbDev->LbaCache);
FreePool (FvbDev);
return EFI_OUT_OF_RESOURCES;
}
@@ -563,6 +564,7 @@ ProduceFVBProtocolOnBuffer ( //
FvbDev->DevicePath = (EFI_DEVICE_PATH_PROTOCOL *)AllocateCopyPool (sizeof (FV_PIWG_DEVICE_PATH), &mFvPIWGDevicePathTemplate);
if (FvbDev->DevicePath == NULL) {
+ FreePool (FvbDev->LbaCache);
FreePool (FvbDev);
return EFI_OUT_OF_RESOURCES;
}
|