From: Qi Zhang Date: Wed, 30 Jan 2019 01:08:54 +0000 (+0800) Subject: net/pcap: fix memory leak X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=9b3d42207c35516b1c62fbdf19da288e5c3d8356;p=dpdk.git net/pcap: fix memory leak Fix potential memory leak due to kvlist not be freed. Fixes: 0d0dd2d9d8ff ("net/pcap: enable data path for secondary process") Cc: stable@dpdk.org Reported-by: Gage Eads Signed-off-by: Qi Zhang Acked-by: Ferruh Yigit --- diff --git a/drivers/net/pcap/rte_eth_pcap.c b/drivers/net/pcap/rte_eth_pcap.c index 9fd932772f..65bbd7e2f4 100644 --- a/drivers/net/pcap/rte_eth_pcap.c +++ b/drivers/net/pcap/rte_eth_pcap.c @@ -1258,7 +1258,8 @@ create_eth: if (pp == NULL) { PMD_LOG(ERR, "Failed to allocate memory for process private"); - return -1; + ret = -1; + goto free_kvlist; } eth_dev->dev_ops = &ops; @@ -1281,7 +1282,7 @@ create_eth: eth_dev->tx_pkt_burst = eth_pcap_tx; rte_eth_dev_probing_finish(eth_dev); - return 0; + goto free_kvlist; } ret = eth_from_pcaps(dev, &pcaps, pcaps.num_of_queue, &dumpers,