shutdown: закрывать shared sqlite (topo_sqlite_db) в самом конце utun_instance_destroy (UAF при teardown)
This commit is contained in:
1 parent
884f36c2d4
commit
d78d652bf5
2 files changed
+11
-2
No files matched your search
@@ -614,6 +614,14 @@ void utun_instance_destroy(struct UTUN_INSTANCE *instance) {
|
||||
instance->nodeinfo_cbks = r->next; u_free(r);
|
||||
}
|
||||
|
||||
// Shared SQLite DB закрываем в самом конце: routing/chat/media/db_sync
|
||||
// используют его во время всего teardown (см. topo_groups_destroy).
|
||||
if (instance->topo_sqlite_db) {
|
||||
sqlite3_close(instance->topo_sqlite_db);
|
||||
instance->topo_sqlite_db = NULL;
|
||||
DEBUG_INFO(DEBUG_CATEGORY_SYS, "[INSTANCE_DESTROY] shared sqlite closed");
|
||||
}
|
||||
|
||||
u_free(instance);
|
||||
DEBUG_INFO(DEBUG_CATEGORY_SYS, "[INSTANCE_DESTROY] Instance destroyed completely");
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user