From mboxrd@z Thu Jan 1 00:00:00 1970 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) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 06 Nov 2017 11:52:28 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.44,354,1505804400"; d="scan'208";a="918211255" Received: from fyigit-mobl1.ger.corp.intel.com (HELO [10.241.225.127]) ([10.241.225.127]) by FMSMGA003.fm.intel.com with ESMTP; 06 Nov 2017 11:52:24 -0800 To: Stefan Baranoff Cc: dev@dpdk.org References: <20171105172445.9401-1-sbaranoff@gmail.com> From: Ferruh Yigit Message-ID: Date: Mon, 6 Nov 2017 11:52:24 -0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: <20171105172445.9401-1-sbaranoff@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH] net/pcap: fix memory leak from missing pcap_close 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, 06 Nov 2017 19:52:30 -0000 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