From nobody Mon May 13 17:30:55 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+114644+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+114644+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1706313694; cv=none; d=zohomail.com; s=zohoarc; b=f8RhvQsm85TNiZrgqr1tF1P/tg5724fUU00cIN9cWnSDotEBFIu888NfGZZOl1fx2tZaCevjY5ko9VLvF/57X6bj3zia3L7iVo7y2M7jCTL1YEpmBwjfiDZ9TbLRsWeiXVfz1/8MGgxT3T6u7BFontdXUh69MA91ADfXtcgwtxQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1706313694; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:References:Sender:Subject:Subject:To:To:Message-Id; bh=8H8KwYYorMkB957FkcB5eQhfER0bXP7SSRYXEPCl4rw=; b=Mvo0ydoNVhoRvph5dbDjniG1sTReo6sYfctrZaJ0bMMy6JADGALaRHBkZB6x6fYvCXoGg0by68EDaK195158IVkWOnb2V2u+fwfbdh5kvoBwFjHaMfruQBKASuirKTFTf5xDJScBLQZHQtVHJu1rhhchUz1VBYpttRLLI2v0+xk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+114644+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1706313694842847.5834295176867; Fri, 26 Jan 2024 16:01:34 -0800 (PST) Return-Path: DKIM-Signature: a=rsa-sha256; bh=x/D06eO12UpZOYYu3XQW3XDrpVAhIsW1x6SLDL3zHIU=; 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=1706313694; v=1; b=qDUWcLmn+QrmVN1v0Lm/3EasSdSM62zNxme1XFJYOY2AGOzjM6dofejNcp60b/bBXS+VFcvp Ld/DZo36D1fdfkcg1qZxF1n6taAgDgsspopAlxT9TpLfcVGhJO5HNSRdQ48MP/3pqiOBqW9KXyh O08jzheJsd0DRewl2qRIYXic= X-Received: by 127.0.0.2 with SMTP id CMWhYY1788612xV3jzs4CQ34; Fri, 26 Jan 2024 16:01:34 -0800 X-Received: from mail-lf1-f54.google.com (mail-lf1-f54.google.com [209.85.167.54]) by mx.groups.io with SMTP id smtpd.web10.5477.1706313693798273987 for ; Fri, 26 Jan 2024 16:01:34 -0800 X-Received: by mail-lf1-f54.google.com with SMTP id 2adb3069b0e04-51025cafb51so1351038e87.2 for ; Fri, 26 Jan 2024 16:01:33 -0800 (PST) X-Gm-Message-State: eZmHwxuEOKlr7GtofwXPFCkKx1787277AA= X-Google-Smtp-Source: AGHT+IHs0zagax5RMXLPmacMjDIMjLU4yFEKwqiY5eMwTruHk8iJ3h7g1iOGu2bBviDUB9JFJxHvaQ== X-Received: by 2002:a05:6512:3192:b0:50e:cd02:b53d with SMTP id i18-20020a056512319200b0050ecd02b53dmr333609lfe.15.1706313691862; Fri, 26 Jan 2024 16:01:31 -0800 (PST) X-Received: from localhost.localdomain ([79.164.221.98]) by smtp.gmail.com with ESMTPSA id u17-20020ac243d1000000b0050f076b43ccsm323874lfl.182.2024.01.26.16.01.31 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 26 Jan 2024 16:01:31 -0800 (PST) From: "Mike Maslenkin" To: devel@edk2.groups.io Cc: abner.chang@amd.com, nicklew@nvidia.com, igork@ami.com, Mike Maslenkin Subject: [edk2-devel] [edk2-redfish-client][PATCH 1/2] RedfishClientPkg: fix uninitialized variable build error Date: Sat, 27 Jan 2024 03:01:27 +0300 Message-Id: <20240127000128.67202-2-mike.maslenkin@gmail.com> In-Reply-To: <20240127000128.67202-1-mike.maslenkin@gmail.com> References: <20240127000128.67202-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-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1706313696827100007 Content-Type: text/plain; charset="utf-8" Variable 'Status' may be used uninitialized in this function [-Werror=3Dmaybe-uninitialized] Signed-off-by: Mike Maslenkin Cc: Abner Chang Cc: Igor Kulchytskyy Reviewed-by: Nickle Wang --- RedfishClientPkg/RedfishFeatureCoreDxe/RedfishFeatureCoreDxe.c | 1 + 1 file changed, 1 insertion(+) diff --git a/RedfishClientPkg/RedfishFeatureCoreDxe/RedfishFeatureCoreDxe.c= b/RedfishClientPkg/RedfishFeatureCoreDxe/RedfishFeatureCoreDxe.c index dce83a8a986f..e76f8d106987 100644 --- a/RedfishClientPkg/RedfishFeatureCoreDxe/RedfishFeatureCoreDxe.c +++ b/RedfishClientPkg/RedfishFeatureCoreDxe/RedfishFeatureCoreDxe.c @@ -152,6 +152,7 @@ StartUpFeatureDriver ( } =20 ThisList =3D ThisFeatureDriverList; + Status =3D EFI_SUCCESS; while (TRUE) { if (ThisList->Callback !=3D NULL) { ThisList->InformationExchange =3D mInformationExchange; --=20 2.32.0 (Apple Git-132) -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#114644): https://edk2.groups.io/g/devel/message/114644 Mute This Topic: https://groups.io/mt/103988339/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Mon May 13 17:30:55 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+114645+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+114645+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1706313695; cv=none; d=zohomail.com; s=zohoarc; b=XT9eNR6Aj28Z8WNWdNdC1Jx2oZpVuuBCLebS8ztwaNEX1r4p4XJAdYpDuUZ3AjsyiRmHHcX5r/ZHZYpXOUXZihT5glK87kPZNQZhpBMrla7FIrNfM97zhPO4RgBLaCqlxNTSsK3c/P9JlMVGZ23/ZGRRcQlY79uyOgteMCTEY/g= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1706313695; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:References:Sender:Subject:Subject:To:To:Message-Id; bh=3Qh/3z534azN7stY/qbL66i53mmPqjmghlgh7AC9fK4=; b=bfUPqk1CDDl73C1PWpsqLeUneLt8sjoJDrx0X6OBkg/fnLI5jCHG5VP65g6A7neUBmuNrfweFa3nQUqqJEeHtyDXxnVRZkJl71twY8brgpdprosdvltcbDuvoyfZ8M0jQC/da4UoGBWGCukXlT5cqvsmJv3ITw9avGACyyWvAWk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+114645+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1706313695771590.5231773023183; Fri, 26 Jan 2024 16:01:35 -0800 (PST) Return-Path: DKIM-Signature: a=rsa-sha256; bh=60/llF4huxcy2576y2Ueoe7L7qjWSsR1UPHyuXspQZY=; 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=1706313695; v=1; b=PQ3JpIkV12xqQf+4j/AzaMwm+sDdaicyvNj3tjm1Gb1RyObycVM4BaykudSilWzoYlOv1J2K AX+J2kqD0qqdq1yTgGCzPPXqWfoU5eMuif374mg6e97e9UVbP5hdjQCqhFWmuIB+RUqL2FMLrAW +1N/05Iz24dyLNXPo2rz0T0M= X-Received: by 127.0.0.2 with SMTP id VrkiYY1788612xW5e8ScwGhV; Fri, 26 Jan 2024 16:01:35 -0800 X-Received: from mail-lf1-f42.google.com (mail-lf1-f42.google.com [209.85.167.42]) by mx.groups.io with SMTP id smtpd.web10.5478.1706313694545459142 for ; Fri, 26 Jan 2024 16:01:34 -0800 X-Received: by mail-lf1-f42.google.com with SMTP id 2adb3069b0e04-51021ba75edso1087333e87.3 for ; Fri, 26 Jan 2024 16:01:34 -0800 (PST) X-Gm-Message-State: ZHZ93fc0AtpzZwbINF16JbXCx1787277AA= X-Google-Smtp-Source: AGHT+IGoXCFdhzTzNjwktdmvp3YetAz+P5MTJCPKnd1bCg1ioYvtKX/rsClHhmmObc4wmQJTvBgfxA== X-Received: by 2002:a05:6512:1284:b0:510:fdd:37d3 with SMTP id u4-20020a056512128400b005100fdd37d3mr345642lfs.65.1706313692554; Fri, 26 Jan 2024 16:01:32 -0800 (PST) X-Received: from localhost.localdomain ([79.164.221.98]) by smtp.gmail.com with ESMTPSA id u17-20020ac243d1000000b0050f076b43ccsm323874lfl.182.2024.01.26.16.01.31 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 26 Jan 2024 16:01:32 -0800 (PST) From: "Mike Maslenkin" To: devel@edk2.groups.io Cc: abner.chang@amd.com, nicklew@nvidia.com, igork@ami.com, Mike Maslenkin Subject: [edk2-devel] [edk2-redfish-client][PATCH 2/2] RedfishClientPkg: fix memory leak in ConverterLib Date: Sat, 27 Jan 2024 03:01:28 +0300 Message-Id: <20240127000128.67202-3-mike.maslenkin@gmail.com> In-Reply-To: <20240127000128.67202-1-mike.maslenkin@gmail.com> References: <20240127000128.67202-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-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1706313696837100008 Content-Type: text/plain; charset="utf-8" The memory returned by json_dumps() must be freed. Signed-off-by: Mike Maslenkin Cc: Abner Chang Cc: Nickle Wang Cc: Igor Kulchytskyy --- RedfishClientPkg/ConverterLib/src/RedfishCsCommon.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/RedfishClientPkg/ConverterLib/src/RedfishCsCommon.c b/RedfishC= lientPkg/ConverterLib/src/RedfishCsCommon.c index 126200dd019c..250ef75e40de 100644 --- a/RedfishClientPkg/ConverterLib/src/RedfishCsCommon.c +++ b/RedfishClientPkg/ConverterLib/src/RedfishCsCommon.c @@ -379,15 +379,19 @@ CreateCsJsonByNode ( if (TempChar !=3D NULL) { Status =3D allocateRecordCsMemory (Cs, sizeof (RedfishCS_Type_JSON_Dat= a), (void **)&CsTypeJson); if (Status !=3D RedfishCS_status_success) { + free (TempChar); return Status; } =20 Status =3D allocateRecordCsMemory (Cs, (RedfishCS_int)strlen (TempChar= ) + 1, (void **)&DumpStr); if (Status !=3D RedfishCS_status_success) { + free (TempChar); return Status; } =20 strncpy (DumpStr, TempChar, strlen (TempChar) + 1); + free (TempChar); + InitializeLinkHead (&CsTypeJson->Header.LinkEntry); CsTypeJson->Header.ResourceType =3D RedfishCS_Type_JSON; CsTypeJson->Header.ThisUri =3D ParentUri; @@ -1506,9 +1510,10 @@ RemoveUnchangeableProperties ( Status =3D RedfishCS_status_insufficient_memory; } else { memcpy (NewJsonBuffer, TempChar, strlen (TempChar) + 1); - free (TempChar); Status =3D RedfishCS_status_success; } + + free (TempChar); } else { Status =3D RedfishCS_status_unknown_error; } --=20 2.32.0 (Apple Git-132) -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#114645): https://edk2.groups.io/g/devel/message/114645 Mute This Topic: https://groups.io/mt/103988340/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-