From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 6A77AA0561; Thu, 18 Mar 2021 10:12:48 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 29FA1140ECF; Thu, 18 Mar 2021 10:12:48 +0100 (CET) Received: from out3-smtp.messagingengine.com (out3-smtp.messagingengine.com [66.111.4.27]) by mails.dpdk.org (Postfix) with ESMTP id 2BDF3140EBF; Thu, 18 Mar 2021 10:12:47 +0100 (CET) Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.nyi.internal (Postfix) with ESMTP id CBC645C0124; Thu, 18 Mar 2021 05:12:44 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Thu, 18 Mar 2021 05:12:44 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:content-type; s=fm3; bh= ArtJkSJZPC5IF0eML24t95le95UcqbwPUT0LSr1GdFE=; b=t6cZrm337q3hiz6Q mKs8XRgBEXmQn/YX5wF9pZ13YUFFpRGOJEMqPj6teiwH5UVLOo34Ffr9Ug9vtMCs yw901T7RIyEx4gAzP0unQIJ8ShUGnQgWWxQDMFJ53sbSNLBkRbWCJSzcrPEVtJLs YltOYgiKKE7TpIS+ykgkchB5qN1zaweR4SNQODkSVEaW+gOfxSbpm96zHe6wx6Ts dB2LGXhZ5QwgPKj25kx5MyYukS1MjGPNCj0XbifCzysan+9W0UANALlM3XalHG7A /UWchBWK4Cs/eVqQc52ptsaNGeWiFUao6HIRFo48zQsKj0+CkU31nKf03358ijK0 /JfX3A== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; bh=ArtJkSJZPC5IF0eML24t95le95UcqbwPUT0LSr1Gd FE=; b=SIM2x71FrGpcCZDadcqwHhmlNYRsmhIWmBgXAUZQLWiNwEiVySqpiFPUa 1lEghB23GFNklUJlOpeE5KO/XfD3aI6K3j7MD3KRw/hoX1UknDgzKeMVzX9htwqj u8xSvh2Mxlo6vhqnCg8FwV/8Wpa96TZXZI+0Sxd82sJrgzrc1BKscsRaSy+jXOcb zuH5AEUtSAvw5xQgnxu89l/iAVxR1MgtuetgfqmAFvM/aHWNUR3AiOkUmOeRniPt MgBExpBPcOwTxeQJ9fKq5cIpIgYJSf71dtbO4AAKnE8bXl6iatw/0AgkWMppHcTT HIhioVNuGFhgqzwBnhF0r2+B4DaFA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrudefiedgtdduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkfgjfhgggfgtsehtufertddttddvnecuhfhrohhmpefvhhhomhgr shcuofhonhhjrghlohhnuceothhhohhmrghssehmohhnjhgrlhhonhdrnhgvtheqnecugg ftrfgrthhtvghrnhepudeggfdvfeduffdtfeeglefghfeukefgfffhueejtdetuedtjeeu ieeivdffgeehnecukfhppeejjedrudefgedrvddtfedrudekgeenucevlhhushhtvghruf hiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehthhhomhgrshesmhhonhhjrghl ohhnrdhnvght X-ME-Proxy: Received: from xps.localnet (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id D93FB1080057; Thu, 18 Mar 2021 05:12:42 -0400 (EDT) From: Thomas Monjalon To: Xueming Li Cc: Ferruh Yigit , Andrew Rybchenko , Olivier Matz , dev@dpdk.org, Viacheslav Ovsiienko , Asaf Penso , gaetan.rivet@6wind.com, stable@dpdk.org Date: Thu, 18 Mar 2021 10:12:40 +0100 Message-ID: <2264479.PKMBTJVty6@thomas> In-Reply-To: <1610983002-7630-2-git-send-email-xuemingl@nvidia.com> References: <1610983002-7630-1-git-send-email-xuemingl@nvidia.com> <1610983002-7630-2-git-send-email-xuemingl@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: Re: [dpdk-dev] [PATCH v2 1/5] devargs: fix memory leak on parsing error X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 18/01/2021 16:16, Xueming Li: > --- a/lib/librte_eal/common/eal_common_devargs.c > +++ b/lib/librte_eal/common/eal_common_devargs.c > + if (ret != 0) { > + if (devargs->data && devargs->data != devstr) { Better to make comparison explicit: if (devargs->data != NULL > + /* Free duplicated data. */ > + free(devargs->data); Before patch 2, devargs->data is const, so we cannot free (compilation error).