diff options
author | Ben Pfaff <blp@ovn.org> | 2017-05-26 20:44:19 -0700 |
---|---|---|
committer | Ben Pfaff <blp@ovn.org> | 2017-05-30 07:48:28 -0700 |
commit | 6851589c0c129ae21f97f1e44c09b15e28efd851 (patch) | |
tree | 804a1dc6a22eb3fc4f78a8cf4b0824cd5bcf830c /utilities | |
parent | 8abe89de9779c35f44d304bb28432e34ec7c3b85 (diff) | |
download | openvswitch-6851589c0c129ae21f97f1e44c09b15e28efd851.tar.gz |
ovn-nbctl, ovn-sbctl, ovs-vsctl: Remove gratuitous NULL checks.
These functions all set txn and do not un-set it within their main
command execution function, so it's gratuitous to check it along this path.
Found by Coverity.
Reported-at: https://scan3.coverity.com/reports.htm#v16889/p10449/fileInstanceId=14763082&defectInstanceId=4305338&mergedDefectId=180417
Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Miguel Angel Ajo <majopela@redhat.com>
Diffstat (limited to 'utilities')
-rw-r--r-- | utilities/ovs-vsctl.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/utilities/ovs-vsctl.c b/utilities/ovs-vsctl.c index 9fe3df03a..28c1c4457 100644 --- a/utilities/ovs-vsctl.c +++ b/utilities/ovs-vsctl.c @@ -2670,11 +2670,10 @@ do_vsctl(const char *args, struct ctl_command *commands, size_t n_commands, try_again: /* Our transaction needs to be rerun, or a prerequisite was not met. Free * resources and return so that the caller can try again. */ - if (txn) { - ovsdb_idl_txn_abort(txn); - ovsdb_idl_txn_destroy(txn); - the_idl_txn = NULL; - } + ovsdb_idl_txn_abort(txn); + ovsdb_idl_txn_destroy(txn); + the_idl_txn = NULL; + ovsdb_symbol_table_destroy(symtab); for (c = commands; c < &commands[n_commands]; c++) { ds_destroy(&c->output); |