From ce7ebcdfd3568d664af30744b9fcf4b72155a466 Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Tue, 2 Feb 2010 14:09:41 -0800 Subject: [PATCH] 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. --- ovsdb/ovsdb-client.c | 2 ++ 1 file changed, 2 insertions(+) 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); } } -- 2.30.2