ovs-vsctl: Fix unitialized variables.
authorJesse Gross <jesse@nicira.com>
Fri, 16 Jul 2010 01:04:10 +0000 (18:04 -0700)
committerJesse Gross <jesse@nicira.com>
Fri, 16 Jul 2010 17:32:13 +0000 (10:32 -0700)
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.

utilities/ovs-vsctl.c

index 0f86231338dedf4a8878024e3925720922a76255..1ff2136089c66d2800629115c654344ce5fdde0f 100644 (file)
@@ -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) {