[ovs-dev] [coverity 12/14] ovsdb: Don't check "date" before assignment in ovsdb_file_txn_from_json().

Justin Pettit jpettit at nicira.com
Tue Feb 22 01:44:55 UTC 2011


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 |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)

diff --git a/ovsdb/file.c b/ovsdb/file.c
index 7061d68..bf72316 100644
--- a/ovsdb/file.c
+++ b/ovsdb/file.c
@@ -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;
-- 
1.7.1





More information about the dev mailing list