From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Monjalon Subject: Re: [PATCH v2] mem: memory leaks of hubedir caused by strdup Date: Tue, 17 Apr 2018 12:24:42 +0200 Message-ID: <1581620.t7eghVUmVK@xps> References: <6821483b-30f3-ac79-208c-406fb46685af@intel.com> <1523959561-17400-1-git-send-email-zhouyates@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit Cc: dev@dpdk.org, anatoly.burakov@intel.com, bruce.richardson@intel.com To: Yangchao Zhou Return-path: Received: from out3-smtp.messagingengine.com (out3-smtp.messagingengine.com [66.111.4.27]) by dpdk.org (Postfix) with ESMTP id 002C38E71 for ; Tue, 17 Apr 2018 12:24:44 +0200 (CEST) In-Reply-To: <1523959561-17400-1-git-send-email-zhouyates@gmail.com> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 17/04/2018 12:06, Yangchao Zhou: > Coverity issue: 272585 > Fixes: cb97d93e9d3b ("mem: share hugepage info primary and secondary") > > Signed-off-by: Yangchao Zhou > Acked-by: Anatoly Burakov Better to provide a small explanation. > - retval = strdup(splitstr[MOUNTPT]); > + snprintf(hugedir, len, "%s", splitstr[MOUNTPT]); I think it is candidate to be replaced by strlcpy. Please check