MdeModulePkg/Core/Dxe: Fix memory leak issue in FwVol.c

FwVolHeader must be freed on error path.

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>
This commit is contained in:
Mike Maslenkin 2023-08-31 17:10:31 -07:00 committed by mergify[bot]
parent 0bcc503595
commit f18ec60fa4
1 changed files with 1 additions and 0 deletions

View File

@ -659,6 +659,7 @@ NotifyFwVolBlock (
//
FvDevice = AllocateCopyPool (sizeof (FV_DEVICE), &mFvDevice);
if (FvDevice == NULL) {
CoreFreePool (FwVolHeader);
return;
}