diff --git a/MdeModulePkg/Library/DxeCapsuleLibFmp/DxeCapsuleReportLib.c b/MdeModulePkg/Library/DxeCapsuleLibFmp/DxeCapsuleReportLib.c index fc0f8698a9..3fed8e06e4 100644 --- a/MdeModulePkg/Library/DxeCapsuleLibFmp/DxeCapsuleReportLib.c +++ b/MdeModulePkg/Library/DxeCapsuleLibFmp/DxeCapsuleReportLib.c @@ -342,6 +342,10 @@ InitCapsuleLastVariable ( 0, NULL ); + } else { + if (CapsuleResult != NULL) { + FreePool (CapsuleResult); + } } }