When run with valgrind, ovn-nbctl.c and tests/test-ovn.c reveal
memory leaks of their own.  This patch cleans these up so that
they don't create noise when looking for leaks in the OVN daemon
processes.

Signed-off-by: Ryan Moats <rmo...@us.ibm.com>
---
 ovn/utilities/ovn-nbctl.c | 1 +
 tests/test-ovn.c          | 4 ++++
 2 files changed, 5 insertions(+)

diff --git a/ovn/utilities/ovn-nbctl.c b/ovn/utilities/ovn-nbctl.c
index d6d64ea..a37fe51 100644
--- a/ovn/utilities/ovn-nbctl.c
+++ b/ovn/utilities/ovn-nbctl.c
@@ -1608,6 +1608,7 @@ nbctl_lr_route_add(struct ctl_context *ctx)
         }
 
         if (!may_exist) {
+            free(rt_prefix);
             ctl_fatal("duplicate prefix: %s", prefix);
         }
 
diff --git a/tests/test-ovn.c b/tests/test-ovn.c
index 0ef09ab..8e9aa15 100644
--- a/tests/test-ovn.c
+++ b/tests/test-ovn.c
@@ -328,6 +328,7 @@ test_dump_symtab(struct ovs_cmdl_context *ctx OVS_UNUSED)
         ds_destroy(&s);
     }
 
+    free(nodes);
     expr_symtab_destroy(&symtab);
     shash_destroy(&symtab);
 }
@@ -1227,6 +1228,8 @@ test_parse_actions(struct ovs_cmdl_context *ctx 
OVS_UNUSED)
             }
             expr_destroy(prereqs2);
 
+            ovnacts_free(ovnacts2.data, ovnacts2.size);
+            ofpbuf_uninit(&ovnacts2);
             ds_destroy(&ovnacts_s);
         } else {
             printf("    %s\n", error);
@@ -1234,6 +1237,7 @@ test_parse_actions(struct ovs_cmdl_context *ctx 
OVS_UNUSED)
         }
 
         expr_destroy(prereqs);
+        ovnacts_free(ovnacts.data, ovnacts.size);
         ofpbuf_uninit(&ovnacts);
     }
     ds_destroy(&input);
-- 
2.7.4

_______________________________________________
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev

Reply via email to