From: Ben Pfaff Date: Fri, 6 Nov 2009 21:36:41 +0000 (-0800) Subject: ovsdb: Fix use-after-free error in ovsdb_destroy(). X-Git-Tag: v1.0.0~259^2~516 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=1248fcd24a6870460441aadcf2039c86dfea0af6;p=sliver-openvswitch.git ovsdb: Fix use-after-free error in ovsdb_destroy(). --- diff --git a/ovsdb/ovsdb.c b/ovsdb/ovsdb.c index e653758fd..1a4b6d8da 100644 --- a/ovsdb/ovsdb.c +++ b/ovsdb/ovsdb.c @@ -245,9 +245,10 @@ ovsdb_destroy(struct ovsdb *db) } shash_destroy(&db->tables); - /* Clear the schema's hash of table schemas. The schemas, but not the - * table that points to them, were deleted in the previous step. */ - shash_destroy(&db->schema->tables); + /* The schemas, but not the table that points to them, were deleted in + * the previous step, so we need to clear out the table. We can't + * destroy the table, because ovsdb_schema_destroy() will do that. */ + shash_clear(&db->schema->tables); ovsdb_schema_destroy(db->schema); ovsdb_file_close(db->file);