Fixing some invalid reads when removing multiple adapters.

This commit is contained in:
Vinicius Costa Gomes 2008-08-22 16:41:22 -03:00
parent 02dacdc326
commit ad0f427712
2 changed files with 6 additions and 3 deletions

View File

@ -847,15 +847,16 @@ static void path_unregister(void *data)
struct network_server *ns = data;
struct network_adapter *na = ns->na;
na->servers = g_slist_remove(na->servers, ns);
server_free(ns);
info("Unregistered interface %s on path %s",
ns->iface, na->path);
na->servers = g_slist_remove(na->servers, ns);
server_free(ns);
if (na->servers)
return;
adapters = g_slist_remove(adapters, na);
adapter_free(na);
}

View File

@ -1009,6 +1009,8 @@ static void manager_path_unregister(void *data)
if (adapter->conn)
dbus_connection_unref(adapter->conn);
adapters = g_slist_remove(adapters, adapter);
g_slist_free(adapter->proxies);
g_free(adapter->path);
g_free(adapter);