Get rid of a pointless copy operation.

Signed-off-by: Jakub Sitnicki <[email protected]>
---
 ovn/utilities/ovn-nbctl.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/ovn/utilities/ovn-nbctl.c b/ovn/utilities/ovn-nbctl.c
index b5de2c305..511068973 100644
--- a/ovn/utilities/ovn-nbctl.c
+++ b/ovn/utilities/ovn-nbctl.c
@@ -4151,7 +4151,6 @@ do_nbctl(const char *args, struct ctl_command *commands, 
size_t n_commands,
     struct ctl_command *c;
     struct shash_node *node;
     int64_t next_cfg = 0;
-    char *error = NULL;
 
     ovs_assert(retry);
 
@@ -4232,7 +4231,6 @@ do_nbctl(const char *args, struct ctl_command *commands, 
size_t n_commands,
             }
         }
     }
-    error = xstrdup(ovsdb_idl_txn_get_error(txn));
 
     switch (status) {
     case TXN_UNCOMMITTED:
@@ -4251,7 +4249,7 @@ do_nbctl(const char *args, struct ctl_command *commands, 
size_t n_commands,
         goto try_again;
 
     case TXN_ERROR:
-        ctl_fatal("transaction error: %s", error);
+        ctl_fatal("transaction error: %s", ovsdb_idl_txn_get_error(txn));
 
     case TXN_NOT_LOCKED:
         /* Should not happen--we never call ovsdb_idl_set_lock(). */
@@ -4260,7 +4258,6 @@ do_nbctl(const char *args, struct ctl_command *commands, 
size_t n_commands,
     default:
         OVS_NOT_REACHED();
     }
-    free(error);
 
     ovsdb_symbol_table_destroy(symtab);
 
@@ -4330,7 +4327,6 @@ do_nbctl(const char *args, struct ctl_command *commands, 
size_t n_commands,
         table_destroy(c->table);
         free(c->table);
     }
-    free(error);
     *retry = true;
     return;
 }
-- 
2.14.4

_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to