From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pa0-f43.google.com (mail-pa0-f43.google.com [209.85.220.43]) by dpdk.org (Postfix) with ESMTP id 9F6935694 for ; Tue, 19 May 2015 23:34:01 +0200 (CEST) Received: by pacwv17 with SMTP id wv17so40565980pac.2 for ; Tue, 19 May 2015 14:33:59 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-type:content-transfer-encoding; bh=ANh5bW8+QCgJJaSighSnyxIXvdDx3T2a0I6KjFPdGCk=; b=ffHdbmpnD2tHAv3LajRq3eIV5isHTFZeHlp2icTZEhcFxvtd68BQQmNojF92Yx4rY+ IgISs8JaKdBfzgHxxpBU0JcSzx3kPwTjHqWIhd6Q4cooj23X6Ti3uzB4BaQgFk4VZ8AD tJ0N0GlcC/0cbU8EMjITqHZQuZv7bGBSCOGeDsWAoy7UJ83CldQ/AMLF8ZGnsEe3OXl0 yFQ6TJxwUiMkhabjqbsoiacXAeAIczYYzQwr+t7o3W7KSxjvhewDaC5nyPLHtruzbASb KDOwFK6bPMbYWx61zmgpU09T7aWgDNTQKRsNFcSqKsqRiktrYznRI1chprXrh/mmgFNG v9VQ== X-Gm-Message-State: ALoCoQmRDWwona82XJAat7CaX/1LNu4ztp+wsEwrUtCh3BcMh2AgkebGZmwaPBH8Xj/sSEFPGwZt X-Received: by 10.66.63.41 with SMTP id d9mr58451883pas.47.1432071239878; Tue, 19 May 2015 14:33:59 -0700 (PDT) Received: from uryu.home.lan ([144.49.132.22]) by mx.google.com with ESMTPSA id yn5sm14082354pac.48.2015.05.19.14.33.59 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 19 May 2015 14:33:59 -0700 (PDT) Date: Tue, 19 May 2015 14:33:55 -0700 From: Stephen Hemminger To: eziegenb Message-ID: <20150519143355.0f35351a@uryu.home.lan> In-Reply-To: <1432065275-26905-1-git-send-email-eziegenb@brocade.com> References: <1432065275-26905-1-git-send-email-eziegenb@brocade.com> X-Mailer: Claws Mail 3.11.1 (GTK+ 2.24.25; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: dev@dpdk.org Subject: Re: [dpdk-dev] [PATCH] Mem: Fixes small memory leak due to missing free. X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 May 2015 21:34:02 -0000 On Tue, 19 May 2015 12:54:35 -0700 eziegenb wrote: > A function in cmdline.c has a return that does not free buf properly. > > Signed-off-by: eziegenb > --- > lib/librte_cmdline/cmdline.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/lib/librte_cmdline/cmdline.c b/lib/librte_cmdline/cmdline.c > index e61c4f2..747d3bb 100644 > --- a/lib/librte_cmdline/cmdline.c > +++ b/lib/librte_cmdline/cmdline.c > @@ -192,8 +192,10 @@ cmdline_printf(const struct cmdline *cl, const char *fmt, ...) > va_start(ap, fmt); > ret = vsnprintf(buf, BUFSIZ, fmt, ap); > va_end(ap); > - if (ret < 0) > + if (ret < 0){ > + free(buf); > return; > + } > if (ret >= BUFSIZ) > ret = BUFSIZ - 1; > write(cl->s_out, buf, ret); Acked-by: Stephen Hemminger