summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ovsdb/ovsdb-server.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/ovsdb/ovsdb-server.c b/ovsdb/ovsdb-server.c
index d803a3d1b..312108f41 100644
--- a/ovsdb/ovsdb-server.c
+++ b/ovsdb/ovsdb-server.c
@@ -531,7 +531,7 @@ close_db(struct server_config *config, struct db *db, char *comment)
static struct ovsdb_error * OVS_WARN_UNUSED_RESULT
parse_txn(struct server_config *config, struct db *db,
- struct ovsdb_schema *schema, const struct json *txn_json,
+ const struct ovsdb_schema *schema, const struct json *txn_json,
const struct uuid *txnid)
{
if (schema && (!db->db->schema || strcmp(schema->version,
@@ -556,7 +556,7 @@ parse_txn(struct server_config *config, struct db *db,
? xasprintf("database %s schema changed", db->db->name)
: xasprintf("database %s connected to storage", db->db->name)));
- ovsdb_replace(db->db, ovsdb_create(schema, NULL));
+ ovsdb_replace(db->db, ovsdb_create(ovsdb_schema_clone(schema), NULL));
/* Force update to schema in _Server database. */
db->row_uuid = UUID_ZERO;
@@ -605,6 +605,7 @@ read_db(struct server_config *config, struct db *db)
} else {
error = parse_txn(config, db, schema, txn_json, &txnid);
json_destroy(txn_json);
+ ovsdb_schema_destroy(schema);
if (error) {
break;
}