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 44AF274006C for ; Tue, 29 Aug 2023 08:01:27 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=V+q+WCshAnynRtaaZ9FvxqW739RWErLj5DWm/FYCRyI=; 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=1693296086; v=1; b=vbqwVD40VaZKa2oSj+T6Uwpza13CGgZcehwv37aGYjpv9hjFwXOItAV2YKn4zuJ1zFRU7F2c 3x3BeKAGNKsESatWAhRRVWP3lou3gWaLUCnEUdvPs7f0WDcv9cBqlSeWmpPG+6VOxwiqAVVprx1 EoV4j+2O+PE0mGv4mO1wUdaU= X-Received: by 127.0.0.2 with SMTP id 3xX4YY7687511xZ4AnYylGhk; Tue, 29 Aug 2023 01:01:26 -0700 X-Received: from mail-lj1-f171.google.com (mail-lj1-f171.google.com [209.85.208.171]) by mx.groups.io with SMTP id smtpd.web10.12621.1693296083788169896 for ; Tue, 29 Aug 2023 01:01:24 -0700 X-Received: by mail-lj1-f171.google.com with SMTP id 38308e7fff4ca-2b9c907bc68so60355541fa.2 for ; Tue, 29 Aug 2023 01:01:23 -0700 (PDT) X-Gm-Message-State: TIDgRgwKH4kBN0YVjR6HHNxix7686176AA= X-Google-Smtp-Source: AGHT+IH2rktwKF+UKHLuxCc50Q2d2ZPqod6PYdnMw30CUjj+aoBZPGJ5l29+6AfG8zliIhiwzFpUVw== X-Received: by 2002:a2e:988d:0:b0:2b9:4413:864e with SMTP id b13-20020a2e988d000000b002b94413864emr20318792ljj.53.1693296081799; Tue, 29 Aug 2023 01:01:21 -0700 (PDT) X-Received: from localhost.localdomain ([79.164.221.98]) by smtp.gmail.com with ESMTPSA id h10-20020a2e900a000000b002ba130e9a29sm2077325ljg.76.2023.08.29.01.01.21 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 29 Aug 2023 01:01:21 -0700 (PDT) From: "Mike Maslenkin" To: devel@edk2.groups.io Cc: abner.chang@amd.com, nicklew@nvidia.com, igork@ami.com, Mike Maslenkin Subject: [edk2-devel] [PATCH v2 4/6] RedfishClientPkg: fix memory leak during EFI variables write. Date: Tue, 29 Aug 2023 11:01:10 +0300 Message-Id: <20230829080112.12748-5-mike.maslenkin@gmail.com> In-Reply-To: <20230829080112.12748-1-mike.maslenkin@gmail.com> References: <20230829080112.12748-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=vbqwVD40; 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 Signed-off-by: Mike Maslenkin --- .../RedfishConfigLangMapDxe/RedfishConfigLangMapDxe.c | 6 +++++- RedfishClientPkg/RedfishETagDxe/RedfishETagDxe.c | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/RedfishClientPkg/RedfishConfigLangMapDxe/RedfishConfigLangMapD= xe.c b/RedfishClientPkg/RedfishConfigLangMapDxe/RedfishConfigLangMapDxe.c index 86684cc72e1e..6a72afed8715 100644 --- a/RedfishClientPkg/RedfishConfigLangMapDxe/RedfishConfigLangMapDxe.c +++ b/RedfishClientPkg/RedfishConfigLangMapDxe/RedfishConfigLangMapDxe.c @@ -424,7 +424,11 @@ SaveConfigLangMapList ( gRT->SetVariable (VariableName, &gEfiRedfishClientVariableGuid, VARIAB= LE_ATTRIBUTE_NV_BS, 0, NULL);=0D }=0D =0D - return gRT->SetVariable (VariableName, &gEfiRedfishClientVariableGuid, V= ARIABLE_ATTRIBUTE_NV_BS, VarSize, (VOID *)VarData);=0D + Status =3D gRT->SetVariable (VariableName, &gEfiRedfishClientVariableGui= d, VARIABLE_ATTRIBUTE_NV_BS, VarSize, (VOID *)VarData);=0D +=0D + FreePool (VarData);=0D +=0D + return Status;=0D }=0D =0D /**=0D diff --git a/RedfishClientPkg/RedfishETagDxe/RedfishETagDxe.c b/RedfishClie= ntPkg/RedfishETagDxe/RedfishETagDxe.c index 7ac6e885dea6..a892ced984c8 100644 --- a/RedfishClientPkg/RedfishETagDxe/RedfishETagDxe.c +++ b/RedfishClientPkg/RedfishETagDxe/RedfishETagDxe.c @@ -411,7 +411,11 @@ SaveETagList ( gRT->SetVariable (VariableName, &gEfiRedfishClientVariableGuid, VARIAB= LE_ATTRIBUTE_NV_BS, 0, NULL);=0D }=0D =0D - return gRT->SetVariable (VariableName, &gEfiRedfishClientVariableGuid, V= ARIABLE_ATTRIBUTE_NV_BS, VarSize, (VOID *)VarData);=0D + Status =3D gRT->SetVariable (VariableName, &gEfiRedfishClientVariableGui= d, VARIABLE_ATTRIBUTE_NV_BS, VarSize, (VOID *)VarData);=0D +=0D + FreePool (VarData);=0D +=0D + return Status;=0D }=0D =0D /**=0D --=20 2.32.0 (Apple Git-132) -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#108082): https://edk2.groups.io/g/devel/message/108082 Mute This Topic: https://groups.io/mt/101027006/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=-