Fixes a fd leak.

Reported-by: Alin Gabriel Serdean <aserd...@cloudbasesolutions.com>
Signed-off-by: Ben Pfaff <b...@ovn.org>
---
 lib/netdev-dummy.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/lib/netdev-dummy.c b/lib/netdev-dummy.c
index 752f15765bb2..62ddd0c67834 100644
--- a/lib/netdev-dummy.c
+++ b/lib/netdev-dummy.c
@@ -708,6 +708,12 @@ netdev_dummy_destruct(struct netdev *netdev_)
     ovs_mutex_unlock(&dummy_list_mutex);
 
     ovs_mutex_lock(&netdev->mutex);
+    if (netdev->rxq_pcap) {
+        fclose(netdev->rxq_pcap);
+    }
+    if (netdev->tx_pcap && netdev->tx_pcap != netdev->rxq_pcap) {
+        fclose(netdev->tx_pcap);
+    }
     dummy_packet_conn_close(&netdev->conn);
     netdev->conn.type = NONE;
 
-- 
2.10.2

_______________________________________________
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to