X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=ovsdb%2Frow.c;h=e25f857aeed85b43a3aa21fb30e7aca0dd27a6c4;hb=859ad376132e1eb13d0a1a28cae2c477300fd45f;hp=dece90fd9d91665e56b0f3245e3091b25116ef0f;hpb=25d4983554f6cf8ce5e169f7c5bb5a08c981d27e;p=openvswitch diff --git a/ovsdb/row.c b/ovsdb/row.c index dece90fd..e25f857a 100644 --- a/ovsdb/row.c +++ b/ovsdb/row.c @@ -31,8 +31,10 @@ static struct ovsdb_row * allocate_row(const struct ovsdb_table *table) { size_t n_fields = shash_count(&table->schema->columns); + size_t n_indexes = table->schema->n_indexes; size_t row_size = (offsetof(struct ovsdb_row, fields) - + sizeof(struct ovsdb_datum) * n_fields); + + sizeof(struct ovsdb_datum) * n_fields + + sizeof(struct hmap_node) * n_indexes); struct ovsdb_row *row = xmalloc(row_size); row->table = (struct ovsdb_table *) table; row->txn_row = NULL;