ovs-vsctl: Free memory on successful exit.
authorBen Pfaff <blp@nicira.com>
Tue, 2 Feb 2010 22:27:22 +0000 (14:27 -0800)
committerBen Pfaff <blp@nicira.com>
Tue, 2 Feb 2010 23:21:10 +0000 (15:21 -0800)
This is not important in itself, but it helps to spot real memory leaks.

Found with valgrind.

utilities/ovs-vsctl.c

index f8863bfc1238990838b39cc58a5622e6829e79a6..981a4e29ae86e1064cb76dc7495f31cf8af1e63b 100644 (file)
@@ -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);
 }