From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Monjalon Subject: Re: [PATCH] eal: reset driver name pointer on failure Date: Sun, 29 Jan 2017 23:35:39 +0100 Message-ID: <2487536.DRxuiboR0Q@xps13> References: <20170124202656.792-1-emmanuel.roullit@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit Cc: dev@dpdk.org, stable@dpdk.org To: Emmanuel Roullit Return-path: Received: from mail-wm0-f48.google.com (mail-wm0-f48.google.com [74.125.82.48]) by dpdk.org (Postfix) with ESMTP id 0C93FD4A4 for ; Sun, 29 Jan 2017 23:35:41 +0100 (CET) Received: by mail-wm0-f48.google.com with SMTP id b65so8606019wmf.0 for ; Sun, 29 Jan 2017 14:35:41 -0800 (PST) In-Reply-To: <20170124202656.792-1-emmanuel.roullit@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" 2017-01-24 21:26, Emmanuel Roullit: > The pointer set by strdup() needs to be cleared on failure to avoid a > potential double-free from the caller. > > Found with clang static analysis: > lib/librte_eal/common/eal_common_devargs.c:123:2: > warning: Attempt to free released memory > free(buf); > ^~~~~~~~~ > > Fixes: 3fe2e5fec82b ("eal: fix argument parsing check") The real bug origin is: Fixes: 0fe11ec592b2 ("eal: add vdev init and uninit") > Signed-off-by: Emmanuel Roullit Applied, thanks