From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from out3-smtp.messagingengine.com (out3-smtp.messagingengine.com [66.111.4.27]) by dpdk.org (Postfix) with ESMTP id 421B54C99 for ; Mon, 22 Oct 2018 10:01:01 +0200 (CEST) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id CBACF229BD; Mon, 22 Oct 2018 04:00:59 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Mon, 22 Oct 2018 04:00:59 -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=mesmtp; bh=SxHstwZ33xztnO+j4pZZkS/KwSmPOMVCjULq6vl+Nxo=; b=lOE7uKhaQwI0 Sy2xd5iInCgrZZW2ADHbDCLnm1BrhlLEVyi7naF/cOdwY2V+dLBLQRafLVw7t55c Yf/E3WRZL9O2KEoYj2BKyTTmWCaVdPMdfGG/V4ZsxUwIFcP6YMdpxCWVXiO2eRgs P4eusXCJnL3nJsa9WMpbRhdGtOfrzwE= 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=fm1; bh=SxHstwZ33xztnO+j4pZZkS/KwSmPOMVCjULq6vl+N xo=; b=O0I94/CQRm/QhGUMwsX8LQYpNSTrNAE7+Jt7Jn7mjkcHBOCxcODcXKuLQ /tR2ON4uD8PgeEHMQ1WM1xhru4xjfFcQbTk1d7CawIe2Iv+p38fZHgVuTpmgKOQp IHkJ3/cwPEVY0/46IZGmK+r3ual8x75HGwjD4JwdZZdvS5iTDZCZxsxN6bZNJRjk f430LEQasH2l0F3wyKsVcOExHQQgSym+P9EIY5K9rp8HPXrmvgdfTzkTC+j5uLly /b45+6rvX7mFHUxi7Oz6RjsbyS57miQysWcZmdxZMD4S8C38XyTwOtb7qhbUTJGa 7FjySJciSmwva/aqa3lUnxz6ZRyYQ== X-ME-Sender: 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 2D795E44D4; Mon, 22 Oct 2018 04:00:58 -0400 (EDT) From: Thomas Monjalon To: Ziye Yang Cc: dev@dpdk.org, konstantin.ananyev@intel.com, Ziye Yang Date: Mon, 22 Oct 2018 10:00:59 +0200 Message-ID: <30207781.zVJTsycACh@xps> In-Reply-To: <1536715910-38320-1-git-send-email-ziye.yang@intel.com> References: <1536125954-46632-1-git-send-email-ziye.yang@intel.com> <1536715910-38320-1-git-send-email-ziye.yang@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: Re: [dpdk-dev] [PATCH v8] linuxapp, eal: Fix the memory leak issue of logid 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: Mon, 22 Oct 2018 08:01:01 -0000 12/09/2018 03:31, Ziye Yang: > From: Ziye Yang > > This patch is used to fix the memory leak issue of logid. > We use the ASAN test in SPDK when intergrating DPDK and > find this memory leak issue. > > Signed-off-by: Ziye Yang > --- > - logid = strrchr(argv[0], '/'); > - logid = strdup(logid ? logid + 1: argv[0]); > - > + p = strrchr(argv[0], '/'); > + snprintf(logid, sizeof(logid), "%s", (p ? p + 1 : argv[0])); Shouldn't it be strlcpy instead of snprintf?