vswitchd: Fix svec memory leaks.
authorBen Pfaff <blp@nicira.com>
Mon, 29 Dec 2008 21:30:48 +0000 (13:30 -0800)
committerBen Pfaff <blp@nicira.com>
Mon, 29 Dec 2008 21:30:48 +0000 (13:30 -0800)
Pointed out by Justin.

vswitchd/bridge.c

index 32016b2532ecc1fa03ca178f2ec93c47d2799f4a..07067adba0f87c60a6cb026c405d78f2c5cc2b40 100644 (file)
@@ -238,6 +238,8 @@ bridge_reconfigure(void)
             bridge_create(name);
         }
     }
+    svec_destroy(&old_br);
+    svec_destroy(&new_br);
 
     /* Reconfigure all bridges. */
     LIST_FOR_EACH (br, struct bridge, node, &all_bridges) {
@@ -519,6 +521,7 @@ start_secchan(struct bridge *br)
 
     /* Start secchan. */
     retval = process_start(argv.names, &sockets[1], 1, &br->secchan);
+    svec_destroy(&argv);
     close(sockets[1]);
     if (retval) {
         VLOG_ERR("%s: failed to start secchan for datapath nl:%d: %s",
@@ -719,6 +722,8 @@ bridge_reconfigure_one(struct bridge *br)
             port_create(br, name);
         }
     }
+    svec_destroy(&old_ports);
+    svec_destroy(&new_ports);
 
     /* Reconfigure all ports. */
     for (i = 0; i < br->n_ports; i++) {
@@ -2047,6 +2052,8 @@ port_reconfigure(struct port *port)
                       port->name);
         }
     }
+    svec_destroy(&old_ifaces);
+    svec_destroy(&new_ifaces);
 }
 
 static void