From: Ben Pfaff Date: Tue, 13 Jan 2009 22:03:24 +0000 (-0800) Subject: vswitchd: Fix memory leaks. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=71a068172e07683b646f49aaa40104dde988f847;p=openvswitch vswitchd: Fix memory leaks. --- diff --git a/vswitchd/bridge.c b/vswitchd/bridge.c index 49b294ec..dde048b9 100644 --- a/vswitchd/bridge.c +++ b/vswitchd/bridge.c @@ -115,7 +115,7 @@ struct port { size_t port_idx; int vlan; /* -1=trunk port, else a 12-bit VLAN ID. */ unsigned long *trunks; /* Bitmap of trunked VLANs, if 'vlan' == -1. */ - const char *name; + char *name; /* An ordinary bridge port has 1 interface. * A bridge port for bonding has at least 2 interfaces. */ @@ -901,6 +901,7 @@ bridge_reconfigure_one(struct bridge *br) i++; } } + svec_destroy(&ifaces); /* Configure remote controller. */ controller = cfg_get_string(0, "bridge.%s.controller", br->name); @@ -2473,6 +2474,7 @@ port_destroy(struct port *port) } free(port->ifaces); free(port->trunks); + free(port->name); free(port); bridge_flush(br); } diff --git a/vswitchd/cfg.c b/vswitchd/cfg.c index d14adad1..788b462b 100644 --- a/vswitchd/cfg.c +++ b/vswitchd/cfg.c @@ -650,6 +650,7 @@ read_file(const char *file_name) } } ds_destroy(&ds); + free(section); svec_sort(&cfg); svec_terminate(&cfg);