rconn_destroy() should close monitoring connections, to avoid a leak.
authorBen Pfaff <blp@nicira.com>
Thu, 27 Nov 2008 00:27:21 +0000 (16:27 -0800)
committerBen Pfaff <blp@nicira.com>
Thu, 27 Nov 2008 06:25:39 +0000 (22:25 -0800)
Our current code base never closes an rconn that has a monitoring
connection, so this does not fix any larger problem.

lib/rconn.c

index e610e61a0d5af11692688bdcad860229fca6802c..ba606fb5eaba2ee1881887d024004dff169c1773 100644 (file)
@@ -264,10 +264,15 @@ void
 rconn_destroy(struct rconn *rc)
 {
     if (rc) {
+        size_t i;
+
         free(rc->name);
         vconn_close(rc->vconn);
         flush_queue(rc);
         queue_destroy(&rc->txq);
+        for (i = 0; i < rc->n_monitors; i++) {
+            vconn_close(rc->monitors[i]);
+        }
         free(rc);
     }
 }