From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.25]) by dpdk.org (Postfix) with ESMTP id 8F1C61B1C4 for ; Fri, 6 Oct 2017 00:33:25 +0200 (CEST) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 21A1020A33; Thu, 5 Oct 2017 18:33:25 -0400 (EDT) Received: from frontend1 ([10.202.2.160]) by compute1.internal (MEProxy); Thu, 05 Oct 2017 18:33:25 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc:x-sasl-enc; s=mesmtp; bh=eOQj3KHFgcN/vVs 65rGneDkvFJI9MnYL7O+VLb6cqVE=; b=QypENoLdV3RL3gk/meptGOWFaQo7PzN zWtFSJEuv7eyA3dc3ROWOmsnEbWRjAgY5PjcE9qxmPAqHfFFmUlYK0WeUXLp6wZX xfUarW44q0OkNeFf/sFpqgc4r5FtNQkUtOA7X//Vj1exAPaEXQNvp6K7qkhxa8oH 3cbUJDYiTHgg= 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-sender:x-me-sender:x-sasl-enc:x-sasl-enc; s= fm1; bh=eOQj3KHFgcN/vVs65rGneDkvFJI9MnYL7O+VLb6cqVE=; b=L5b3J/YO Q85fx2LQ+NLXSjXyuGj4p7cdfQwQYrmhSN9IUTAnGFEL8BVwgvsC3YDGju8TAd53 F8Er0mI27slRPB/QW7RqdTwPryS5ZD/rbsqfXTDIwdel+cPcmbTH3e0DI8lSXSsq 0gWtCZ1yR1zifVviZn3bNGPkuglJCstfyDz7kXubmaiwNi3DZ7zABXRno9tla2iE 7YbtvIRi27RR2MZDiCnAIC1NApN3M5AM3X4LrcXz4XRVCm5+kBGf40bR7+exLJOy isfEBa0lN071OTVcjmH64XQdrZQfK9i0eTdXHa/sy7fbYPIy6LnQKHjlShIJSuWl rN5OsbeeoWsBzg== X-ME-Sender: X-Sasl-enc: 7vkTzX5VCWRXa7J9AVMVFDc1ugkV0DR431VCvwbm3pcT 1507242804 Received: from xps.localnet (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id C576B7E4ED; Thu, 5 Oct 2017 18:33:24 -0400 (EDT) From: Thomas Monjalon To: Ferruh Yigit , Daniel Mrzyglod Cc: dev@dpdk.org Date: Fri, 06 Oct 2017 00:33:23 +0200 Message-ID: <4160089.UZJ91qkqPz@xps> In-Reply-To: <27670627-01f0-7fff-0aa8-c9a9d2b89e3d@intel.com> References: <20170919133432.6437-1-danielx.t.mrzyglod@intel.com> <20170922144820.16590-1-danielx.t.mrzyglod@intel.com> <27670627-01f0-7fff-0aa8-c9a9d2b89e3d@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: Re: [dpdk-dev] [PATCH v2] eal: fix resource leak X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Oct 2017 22:33:25 -0000 04/10/2017 21:24, Ferruh Yigit: > On 9/22/2017 3:48 PM, Daniel Mrzyglod wrote: > > Memory allocated in strdup is not free. > > > > Coverity issue: 143257 > > Fixes: d8a2bc71dfc2 ("log: remove app path from syslog id") > > Cc: thomas@monjalon.net > > > > Signed-off-by: Daniel Mrzyglod > > --- > This works but this variable is a nuance and adding free() for this it > into main eal features fail path looks like noise. > > Initially, do we need to strdup this variable at all? > What will happen if logid fed into rte_eal_log_init() without strdup? > Since it is const char *, I guess the string is just for read and > content won't be changed so it should be OK I guess. > > If above is not right, what about creating a static variable and use it > instead of dynamically allocating the logid, what do you think? Good proposal Ferruh. It seems strdup is not needed as it is basically argv[0].