From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from out4-smtp.messagingengine.com (out4-smtp.messagingengine.com [66.111.4.28]) by dpdk.org (Postfix) with ESMTP id D33DA236 for ; Tue, 21 Nov 2017 14:31:17 +0100 (CET) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 4D4F520B68; Tue, 21 Nov 2017 08:31:17 -0500 (EST) Received: from frontend2 ([10.202.2.161]) by compute1.internal (MEProxy); Tue, 21 Nov 2017 08:31:17 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fridaylinux.org; h=cc:date:from:in-reply-to:message-id:references:subject:to :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=ouFVpmQ2zYUEShIua fYMur3wMVpEDJX3YSOtdf2PfVI=; b=jY+TwKWGx0urNGhoh0/9jze0VsCfq8wJG 3OPZVYqG2heV+XgxdFlbSkqggqgP9JpyXbf6cUetn9YhMELo0Nt36kd9B7lC2SsF wH41jvosyerLFWOKRJiNhM8jMLBpI4fW8GJeZ/3zQY5x1ReTPtoJZdMn0DQsG8El I7VRK2+Jc8FygBV7QZu1asJJX1hvZNxBBpqRxP9BIAoqQEYh1ecdmMysP2bn48Z/ N8EJwsKHaDYA9R/k8Q4fMw56JZ8vmVcUZHgiBNaccFvvXfKkavln5/swsM4voHNq +NmcyfNI9+0+X8x0CfUQHajmZLO9ny35rlcG/vPpke6zIQ3YOttsw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:date:from:in-reply-to:message-id :references:subject:to:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; bh=ouFVpmQ2zYUEShIuafYMur3wMVpEDJX3YSOtdf2PfVI=; b=JS7IWRwm dIYCyG/FmNvxyeiuHrhfMT0u6F4AmnrxjFcD21mti9UoaChLQYPY2lpdqIS0fhpk NvzaaJBkmoAoZFpjee0DCeMqvo95IdIPWAoZMT+mgIPqnx32ALuL+EbiFGixOWUz t6hDf5MvMuxmBlzvQFKpMb/miUoU505xJs0qKhK8puNwT3MXOMyEUHb4GZ3P+yS7 mBQliWRYQSa8YLMD2+ALpA/+WhUvw+r8ONvjGC9kVrhtoxvfEf274Jm1VzWFrLJs HJsJXWi//LCKfO48H9rp9gaaCJTOuiZm3pjiHBktRL+no7AMw8CuKXTvZIbSKIHa h0LeeBNtCu5lnQ== X-ME-Sender: Received: from localhost.localdomain (unknown [180.158.62.0]) by mail.messagingengine.com (Postfix) with ESMTPA id D1CBF24810; Tue, 21 Nov 2017 08:31:14 -0500 (EST) From: Yuanhan Liu To: Stefan Baranoff Cc: Ferruh Yigit , dpdk stable Date: Tue, 21 Nov 2017 21:18:47 +0800 Message-Id: <1511270333-31002-185-git-send-email-yliu@fridaylinux.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1511270333-31002-1-git-send-email-yliu@fridaylinux.org> References: <1511270333-31002-1-git-send-email-yliu@fridaylinux.org> Subject: [dpdk-stable] patch 'net/pcap: fix memory leak in dumper open' has been queued to stable release 17.08.1 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Nov 2017 13:31:18 -0000 Hi, FYI, your patch has been queued to stable release 17.08.1 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 11/24/17. So please shout if anyone has objections. Thanks. --yliu --- >>From 3367368167c948ddd0f5ae016962b62c176d95a1 Mon Sep 17 00:00:00 2001 From: Stefan Baranoff Date: Sun, 5 Nov 2017 12:24:45 -0500 Subject: [PATCH] net/pcap: fix memory leak in dumper open [ upstream commit e59196e01c1456e8ea0e9b2056651ef64dc17b78 ] 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. Fixes: 4c173302c307 ("pcap: add new driver") Signed-off-by: Stefan Baranoff Acked-by: Ferruh Yigit --- drivers/net/pcap/rte_eth_pcap.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/net/pcap/rte_eth_pcap.c b/drivers/net/pcap/rte_eth_pcap.c index defb3b4..d6d4f8e 100644 --- a/drivers/net/pcap/rte_eth_pcap.c +++ b/drivers/net/pcap/rte_eth_pcap.c @@ -411,11 +411,13 @@ open_single_tx_pcap(const char *pcap_filename, pcap_dumper_t **dumper) /* The dumper is created using the previous pcap_t reference */ *dumper = pcap_dump_open(tx_pcap, pcap_filename); if (*dumper == NULL) { + pcap_close(tx_pcap); RTE_LOG(ERR, PMD, "Couldn't open %s for writing.\n", pcap_filename); return -1; } + pcap_close(tx_pcap); return 0; } -- 2.7.4