From: Ben Pfaff Date: Tue, 2 Feb 2010 22:09:41 +0000 (-0800) Subject: ovsdb-client: Fix memory leaks in "monitor" command. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ce7ebcdfd3568d664af30744b9fcf4b72155a466;p=openvswitch ovsdb-client: Fix memory leaks in "monitor" command. This is a long-running command so it makes sense to free received messages. Freeing the schema at exit is not essential but cleans up valgrind output. Found with valgrind. --- diff --git a/ovsdb/ovsdb-client.c b/ovsdb/ovsdb-client.c index 02946df6..e7d3b50d 100644 --- a/ovsdb/ovsdb-client.c +++ b/ovsdb/ovsdb-client.c @@ -833,6 +833,7 @@ do_monitor(int argc, char *argv[]) error = jsonrpc_recv_block(rpc, &msg); if (error) { + ovsdb_schema_destroy(schema); ovs_fatal(error, "%s: receive failed", argv[1]); } @@ -862,6 +863,7 @@ do_monitor(int argc, char *argv[]) fflush(stdout); } } + jsonrpc_msg_destroy(msg); } }