diff mbox series

[ovs-dev,v4,05/21] ovn-nbctl: Pull up releasing IDL from do_nbctl().

Message ID 20180719123632.19617-6-jkbs@redhat.com
State Superseded
Headers show
Series Daemon mode for ovn-nbctl | expand

Commit Message

Jakub Sitnicki July 19, 2018, 12:36 p.m. UTC
Destroy IDL resources in the routine where we allocated them.

Preparatory work for reusing the main loop in daemon mode.

Signed-off-by: Jakub Sitnicki <jkbs@redhat.com>
---
 ovn/utilities/ovn-nbctl.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/ovn/utilities/ovn-nbctl.c b/ovn/utilities/ovn-nbctl.c
index 51527741b..a700695fe 100644
--- a/ovn/utilities/ovn-nbctl.c
+++ b/ovn/utilities/ovn-nbctl.c
@@ -126,6 +126,9 @@  main(int argc, char *argv[])
 
     main_loop(args, commands, n_commands, idl);
 
+    ovsdb_idl_destroy(idl);
+    idl = the_idl = NULL;
+
     for (struct ctl_command *c = commands; c < &commands[n_commands]; c++) {
         ds_destroy(&c->output);
         table_destroy(c->table);
@@ -4299,7 +4302,6 @@  do_nbctl(const char *args, struct ctl_command *commands, size_t n_commands,
     }
 
     ovsdb_idl_txn_destroy(txn);
-    ovsdb_idl_destroy(idl);
 
     return true;