From 5cdb96fa0d5f689cb4b3b17ddd2cec164842aebd Mon Sep 17 00:00:00 2001 From: Laszlo Ersek Date: Wed, 20 Nov 2013 22:31:14 +0000 Subject: OvmfPkg/QemuVideoDxe: don't leak descriptors returned by GetBarAttributes Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek Reviewed-by: Jordan Justen git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@14877 6f19259b-4bc3-4df7-8a09-765794883524 --- OvmfPkg/QemuVideoDxe/Driver.c | 4 ++++ OvmfPkg/QemuVideoDxe/Gop.c | 1 + 2 files changed, 5 insertions(+) diff --git a/OvmfPkg/QemuVideoDxe/Driver.c b/OvmfPkg/QemuVideoDxe/Driver.c index 1dd8899fcf..53718e1aea 100644 --- a/OvmfPkg/QemuVideoDxe/Driver.c +++ b/OvmfPkg/QemuVideoDxe/Driver.c @@ -305,6 +305,10 @@ QemuVideoControllerDriverStart ( DEBUG ((EFI_D_INFO, "QemuVideo: Using mmio bar @ 0x%lx\n", MmioDesc->AddrRangeMin)); } + + if (!EFI_ERROR (Status)) { + FreePool (MmioDesc); + } } // diff --git a/OvmfPkg/QemuVideoDxe/Gop.c b/OvmfPkg/QemuVideoDxe/Gop.c index 1d2402cded..30aac7f95f 100644 --- a/OvmfPkg/QemuVideoDxe/Gop.c +++ b/OvmfPkg/QemuVideoDxe/Gop.c @@ -72,6 +72,7 @@ QemuVideoCompleteModeData ( Mode->FrameBufferSize = Mode->FrameBufferSize * ((ModeData->ColorDepth + 7) / 8); DEBUG ((EFI_D_INFO, "FrameBufferBase: 0x%x, FrameBufferSize: 0x%x\n", Mode->FrameBufferBase, Mode->FrameBufferSize)); + FreePool (FrameBufDesc); return EFI_SUCCESS; } -- cgit v1.2.3