ovsdb: Don't check "date" before assignment in ovsdb_file_txn_from_json().
authorJustin Pettit <jpettit@nicira.com>
Tue, 22 Feb 2011 01:02:35 +0000 (17:02 -0800)
committerJustin Pettit <jpettit@nicira.com>
Tue, 22 Feb 2011 18:14:53 +0000 (10:14 -0800)
There's no indication that "date" is optional in the description of
ovsdb_file_txn_from_json(), and the one caller always passes it in, so
don't bother checking whether it exists.

Coverity #10732

ovsdb/file.c

index 7061d682055e71afe9a364393829f3ddb1359a70..bf72316ccf19c01f5e20b86ef180062370fe7160 100644 (file)
@@ -404,9 +404,7 @@ ovsdb_file_txn_from_json(struct ovsdb *db, const struct json *json,
         if (!table) {
             if (!strcmp(table_name, "_date")
                 && node_json->type == JSON_INTEGER) {
-                if (date) {
-                    *date = json_integer(node_json);
-                }
+                *date = json_integer(node_json);
                 continue;
             } else if (!strcmp(table_name, "_comment") || converting) {
                 continue;