From: Jesse Gross Date: Fri, 16 Jul 2010 01:04:10 +0000 (-0700) Subject: ovs-vsctl: Fix unitialized variables. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=af9af3e21d307b5de2cdb69aecb3b8b5e7505cbc;p=openvswitch ovs-vsctl: Fix unitialized variables. The compiler pointed out two variables that it thought were used without being initialized. The first was just a spurious warning but the second could result in an unitialized pointer being freed. This fixes both of those issues. --- diff --git a/utilities/ovs-vsctl.c b/utilities/ovs-vsctl.c index 0f862313..1ff21360 100644 --- a/utilities/ovs-vsctl.c +++ b/utilities/ovs-vsctl.c @@ -2654,7 +2654,7 @@ is_condition_satified(const struct vsctl_table_class *table, const char *operator; unsigned int idx; char *error; - int cmp; + int cmp = 0; error = parse_column_key_value(arg, table, &column, &key_string, &operator, operators, ARRAY_SIZE(operators), @@ -2787,7 +2787,7 @@ do_vsctl(const char *args, struct vsctl_command *commands, size_t n_commands, const char *unused; struct vsctl_command *c; int64_t next_cfg = 0; - char *error; + char *error = NULL; txn = the_idl_txn = ovsdb_idl_txn_create(idl); if (dry_run) {