From: Ben Pfaff Date: Tue, 2 Feb 2010 22:27:22 +0000 (-0800) Subject: ovs-vsctl: Free memory on successful exit. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b86b43aa485b5ab613ee6853b58f070db35339c9;p=openvswitch ovs-vsctl: Free memory on successful exit. This is not important in itself, but it helps to spot real memory leaks. Found with valgrind. --- diff --git a/utilities/ovs-vsctl.c b/utilities/ovs-vsctl.c index f8863bfc..981a4e29 100644 --- a/utilities/ovs-vsctl.c +++ b/utilities/ovs-vsctl.c @@ -2581,7 +2581,10 @@ do_vsctl(const char *args, struct vsctl_command *commands, size_t n_commands, } else { fputs(ds_cstr(ds), stdout); } + ds_destroy(&c->output); + shash_destroy(&c->options); } + free(commands); if (wait_for_reload && status != TXN_UNCHANGED) { for (;;) { @@ -2598,6 +2601,7 @@ do_vsctl(const char *args, struct vsctl_command *commands, size_t n_commands, } done: ; } + ovsdb_idl_destroy(idl); exit(EXIT_SUCCESS); }