Fixes a fd leak.

Reported-by: Alin Gabriel Serdean <[email protected]>
Signed-off-by: Ben Pfaff <[email protected]>
---
 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
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to