X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=ovsdb%2Fexecution.c;h=e2f10cbb268187e3c93f862d7ee3c7e1547e20a8;hb=81158e4f4a7071c689aac7ac4fb1389c8e8d3875;hp=b984b1b528c73ea57233284913935678494b48f0;hpb=02dd3123a0e312f1d33403e744af52dd6096f12d;p=openvswitch diff --git a/ovsdb/execution.c b/ovsdb/execution.c index b984b1b5..e2f10cbb 100644 --- a/ovsdb/execution.c +++ b/ovsdb/execution.c @@ -103,8 +103,6 @@ ovsdb_execute(struct ovsdb *db, const struct json *params, || !params->u.array.n || params->u.array.elems[0]->type != JSON_STRING || strcmp(params->u.array.elems[0]->u.string, db->schema->name)) { - struct ovsdb_error *error; - if (params->type != JSON_ARRAY) { error = ovsdb_syntax_error(params, NULL, "array expected"); } else { @@ -137,7 +135,7 @@ ovsdb_execute(struct ovsdb *db, const struct json *params, /* Parse and execute operation. */ ovsdb_parser_init(&parser, operation, - "ovsdb operation %zu of %zu", i + 1, n_operations); + "ovsdb operation %zu of %zu", i, n_operations); op = ovsdb_parser_member(&parser, "op", OP_ID); result = json_object_create(); if (op) { @@ -294,6 +292,7 @@ ovsdb_execute_insert(struct ovsdb_execution *x, struct ovsdb_parser *parser, symbol = ovsdb_symbol_table_insert(x->symtab, json_string(uuid_name)); if (symbol->used) { + ovsdb_error_destroy(error); return ovsdb_syntax_error(uuid_name, "duplicate uuid-name", "This \"uuid-name\" appeared on an " "earlier \"insert\" operation."); @@ -629,7 +628,6 @@ ovsdb_execute_wait(struct ovsdb_execution *x, struct ovsdb_parser *parser, /* Parse "rows" into 'expected'. */ ovsdb_row_hash_init(&expected, &columns); for (i = 0; i < rows->u.array.n; i++) { - struct ovsdb_error *error; struct ovsdb_row *row; row = ovsdb_row_create(table);