From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ferruh Yigit Subject: Re: [PATCH] net/pcap: fix memory leak from missing pcap_close Date: Mon, 6 Nov 2017 11:52:24 -0800 Message-ID: References: <20171105172445.9401-1-sbaranoff@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Cc: dev@dpdk.org To: Stefan Baranoff Return-path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id 1D17A1B2C8 for ; Mon, 6 Nov 2017 20:52:29 +0100 (CET) In-Reply-To: <20171105172445.9401-1-sbaranoff@gmail.com> Content-Language: en-US List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On 11/5/2017 9:24 AM, Stefan Baranoff wrote: > In open_single_tx_pcap there is a call to pcap_open_dead which calls > malloc to create and return a pcap_t. That object is never freed in > this case. Other places it is freed by passing it back similar to the > way the pcap_dumper_t is in this case. > > The pcap_t is only used to create the pcap_dumper_t and is never used > again so freeing it here is safe and much simpler than trying to pass > it back to be freed in eth_dev_stop along with the other > pcap_t/pcap_dumper_t objects. > > Signed-off-by: Stefan Baranoff net/pcap: fix memory leak in dumper open Fixes: 4c173302c307 ("pcap: add new driver") Cc: stable@dpdk.org Acked-by: Ferruh Yigit