From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by spool.mail.gandi.net (Postfix) with ESMTPS id 505A1740032 for ; Fri, 1 Sep 2023 00:10:46 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=NUpuxXUxe2rW0Z8Q9qFsIIvpnJv+EYf0WR6Ziu8uwpM=; c=relaxed/simple; d=groups.io; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Transfer-Encoding; s=20140610; t=1693527045; v=1; b=SI0UGk0RxZipMvav9sRGoE8QXeW3kLSNeG59bFAbjDtnmxKcJLaym2X/ZA/a/TzMCu2vAnzl v6PDtqNVOmgIcCsBmOPKO/073mOO00on5nTHklUjaQhs+zdllnrfjcN84kyQVIfb5/msZjNz6Rw tx2RDABLBGxIA5jZVpiQ4O7I= X-Received: by 127.0.0.2 with SMTP id kSV5YY7687511xL6cREH2uHC; Thu, 31 Aug 2023 17:10:45 -0700 X-Received: from mail-lf1-f52.google.com (mail-lf1-f52.google.com [209.85.167.52]) by mx.groups.io with SMTP id smtpd.web11.9782.1693527044131436071 for ; Thu, 31 Aug 2023 17:10:44 -0700 X-Received: by mail-lf1-f52.google.com with SMTP id 2adb3069b0e04-500b6456c7eso2667986e87.2 for ; Thu, 31 Aug 2023 17:10:43 -0700 (PDT) X-Gm-Message-State: aEo76cO3MVYJJ1NGWzf0i6vRx7686176AA= X-Google-Smtp-Source: AGHT+IF8c8J9ECjWJfkosVa/ZxED8Q2sl/co3Qgr8ifBF2YPtHePBdZK42WZzYJ+iHdFgphlUCN9tg== X-Received: by 2002:a05:6512:a8e:b0:4ff:ad35:8dce with SMTP id m14-20020a0565120a8e00b004ffad358dcemr638930lfu.22.1693527042246; Thu, 31 Aug 2023 17:10:42 -0700 (PDT) X-Received: from localhost.localdomain ([79.164.221.98]) by smtp.gmail.com with ESMTPSA id h22-20020a197016000000b004ffa0350851sm461422lfc.78.2023.08.31.17.10.40 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 31 Aug 2023 17:10:41 -0700 (PDT) From: "Mike Maslenkin" To: devel@edk2.groups.io Cc: dandan.bi@intel.com, gaoliming@byosoft.com.cn, michael.d.kinney@intel.com, nathaniel.l.desimone@intel.com, Mike Maslenkin Subject: [edk2-devel] [PATCH 2/2] MdeModulePkg/Core/Dxe: Fix memory leak issue in FwVolBlock.c Date: Fri, 1 Sep 2023 03:10:32 +0300 Message-Id: <20230901001032.52136-3-mike.maslenkin@gmail.com> In-Reply-To: <20230901001032.52136-1-mike.maslenkin@gmail.com> References: <20230901001032.52136-1-mike.maslenkin@gmail.com> MIME-Version: 1.0 Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,mike.maslenkin@gmail.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: Content-Transfer-Encoding: quoted-printable X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=SI0UGk0R; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io FvbDev->LbaCache must be freed on error path before deallocating FvbDev. Signed-off-by: Mike Maslenkin --- MdeModulePkg/Core/Dxe/FwVolBlock/FwVolBlock.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/MdeModulePkg/Core/Dxe/FwVolBlock/FwVolBlock.c b/MdeModulePkg/C= ore/Dxe/FwVolBlock/FwVolBlock.c index d81334ce24d1..9f5f40e5cd49 100644 --- a/MdeModulePkg/Core/Dxe/FwVolBlock/FwVolBlock.c +++ b/MdeModulePkg/Core/Dxe/FwVolBlock/FwVolBlock.c @@ -551,6 +551,7 @@ ProduceFVBProtocolOnBuffer ( //=0D FvbDev->DevicePath =3D (EFI_DEVICE_PATH_PROTOCOL *)AllocateCopyPool (s= izeof (FV_MEMMAP_DEVICE_PATH), &mFvMemmapDevicePathTemplate);=0D if (FvbDev->DevicePath =3D=3D NULL) {=0D + FreePool (FvbDev->LbaCache);=0D FreePool (FvbDev);=0D return EFI_OUT_OF_RESOURCES;=0D }=0D @@ -563,6 +564,7 @@ ProduceFVBProtocolOnBuffer ( //=0D FvbDev->DevicePath =3D (EFI_DEVICE_PATH_PROTOCOL *)AllocateCopyPool (s= izeof (FV_PIWG_DEVICE_PATH), &mFvPIWGDevicePathTemplate);=0D if (FvbDev->DevicePath =3D=3D NULL) {=0D + FreePool (FvbDev->LbaCache);=0D FreePool (FvbDev);=0D return EFI_OUT_OF_RESOURCES;=0D }=0D --=20 2.32.0 (Apple Git-132) -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#108222): https://edk2.groups.io/g/devel/message/108222 Mute This Topic: https://groups.io/mt/101085565/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=-