From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by mx.groups.io with SMTP id smtpd.web10.3295.1574988848631999554 for ; Thu, 28 Nov 2019 16:54:08 -0800 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 134.134.136.100, mailfrom: jiaxin.wu@intel.com) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 28 Nov 2019 16:54:07 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.69,255,1571727600"; d="scan'208";a="240872238" Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by fmsmga002.fm.intel.com with ESMTP; 28 Nov 2019 16:54:07 -0800 Received: from fmsmsx112.amr.corp.intel.com (10.18.116.6) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.439.0; Thu, 28 Nov 2019 16:54:07 -0800 Received: from shsmsx101.ccr.corp.intel.com (10.239.4.153) by FMSMSX112.amr.corp.intel.com (10.18.116.6) with Microsoft SMTP Server (TLS) id 14.3.439.0; Thu, 28 Nov 2019 16:54:06 -0800 Received: from shsmsx107.ccr.corp.intel.com ([169.254.9.63]) by SHSMSX101.ccr.corp.intel.com ([169.254.1.213]) with mapi id 14.03.0439.000; Fri, 29 Nov 2019 08:54:05 +0800 From: "Wu, Jiaxin" To: "devel@edk2.groups.io" , "maciej.rabeda@linux.intel.com" CC: "Fu, Siyuan" Subject: Re: [edk2-devel] [PATCH v1 1/1] NetworkPkg: Fixes to static code analysis hits Thread-Topic: [edk2-devel] [PATCH v1 1/1] NetworkPkg: Fixes to static code analysis hits Thread-Index: AQHVpfqWdjcpTBLnkUOH8w9lH9pGTaehUu3Q Date: Fri, 29 Nov 2019 00:54:04 +0000 Message-ID: <895558F6EA4E3B41AC93A00D163B727416FACE49@SHSMSX107.ccr.corp.intel.com> References: <20191128144606.2040-1-maciej.rabeda@linux.intel.com> <20191128144606.2040-2-maciej.rabeda@linux.intel.com> In-Reply-To: <20191128144606.2040-2-maciej.rabeda@linux.intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiNjk0NGYwODYtZTMwNC00MGViLWFiMTktNzFlMzc3OGY3ZGJhIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoidWx0UEVIV3pOeWx2bE9Cc3JyU2JQT3BnTG9ieTJkYnpZYnRjaWEyQ05JZitINVVIWEFNT1c1ZXZ4Q2JkczAwVSJ9 x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.2.0.6 dlp-reaction: no-action x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Return-Path: jiaxin.wu@intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Jiaxin Wu > -----Original Message----- > From: devel@edk2.groups.io On Behalf Of Maciej > Rabeda > Sent: Thursday, November 28, 2019 10:46 PM > To: devel@edk2.groups.io > Cc: Wu, Jiaxin ; Fu, Siyuan > Subject: [edk2-devel] [PATCH v1 1/1] NetworkPkg: Fixes to static code > analysis hits >=20 > Introducing fixes to memory leak issues identified by static code analysi= s > tool. >=20 > Cc: Jiaxin Wu > Cc: Siyuan Fu > Signed-off-by: Maciej Rabeda > --- > NetworkPkg/Dhcp6Dxe/Dhcp6Io.c | 1 + > NetworkPkg/Ip4Dxe/Ip4If.c | 6 +++++- > NetworkPkg/TcpDxe/TcpDispatcher.c | 1 + > 3 files changed, 7 insertions(+), 1 deletion(-) >=20 > diff --git a/NetworkPkg/Dhcp6Dxe/Dhcp6Io.c > b/NetworkPkg/Dhcp6Dxe/Dhcp6Io.c > index 4f8393cb36ce..613b42149cc1 100644 > --- a/NetworkPkg/Dhcp6Dxe/Dhcp6Io.c > +++ b/NetworkPkg/Dhcp6Dxe/Dhcp6Io.c > @@ -203,6 +203,7 @@ Dhcp6EnqueueRetry ( > // >=20 > // Unexpected message type. >=20 > // >=20 > + FreePool(TxCb); >=20 > return EFI_DEVICE_ERROR; >=20 > } >=20 >=20 >=20 > diff --git a/NetworkPkg/Ip4Dxe/Ip4If.c b/NetworkPkg/Ip4Dxe/Ip4If.c > index 53a333037f94..348f2e076aed 100644 > --- a/NetworkPkg/Ip4Dxe/Ip4If.c > +++ b/NetworkPkg/Ip4Dxe/Ip4If.c > @@ -491,9 +491,13 @@ Ip4CreateInterface ( > IP4_INTERFACE *Interface; >=20 > EFI_SIMPLE_NETWORK_MODE SnpMode; >=20 >=20 >=20 > + if (Mnp =3D=3D NULL) { >=20 > + return NULL; >=20 > + } >=20 > + >=20 > Interface =3D AllocatePool (sizeof (IP4_INTERFACE)); >=20 >=20 >=20 > - if ((Interface =3D=3D NULL) || (Mnp =3D=3D NULL)) { >=20 > + if (Interface =3D=3D NULL) { >=20 > return NULL; >=20 > } >=20 >=20 >=20 > diff --git a/NetworkPkg/TcpDxe/TcpDispatcher.c > b/NetworkPkg/TcpDxe/TcpDispatcher.c > index 86beaf8cc513..9ae08ccc1c56 100644 > --- a/NetworkPkg/TcpDxe/TcpDispatcher.c > +++ b/NetworkPkg/TcpDxe/TcpDispatcher.c > @@ -390,6 +390,7 @@ TcpAttachPcb ( > ); >=20 > if (EFI_ERROR (Status)) { >=20 > IpIoRemoveIp (IpIo, Tcb->IpInfo); >=20 > + FreePool (Tcb); >=20 > return Status; >=20 > } >=20 >=20 >=20 > -- > 2.24.0.windows.2 >=20 >=20 > -=3D-=3D-=3D-=3D-=3D-=3D > Groups.io Links: You receive all messages sent to this group. >=20 > View/Reply Online (#51464): https://edk2.groups.io/g/devel/message/51464 > Mute This Topic: https://groups.io/mt/64137254/1787330 > Group Owner: devel+owner@edk2.groups.io > Unsubscribe: https://edk2.groups.io/g/devel/unsub [jiaxin.wu@intel.com] > -=3D-=3D-=3D-=3D-=3D-=3D