mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-04-26 14:50:47 +02:00
cli: additional fix for nmcli connection down
nmcli crashed when a timeout was hit, because 'info' was used after freeing
in down_timeout_cb().
Fixes 4a7c88621d.
This commit is contained in:
parent
4a7c88621d
commit
1a4259d23a
1 changed files with 13 additions and 6 deletions
|
|
@ -2249,10 +2249,6 @@ down_timeout_cb (gpointer user_data)
|
|||
{
|
||||
DeactivateConnectionInfo *info = user_data;
|
||||
|
||||
while (info->queue)
|
||||
deactivate_connection_info_finish (info, info->queue->data);
|
||||
|
||||
info->timeout_id = 0;
|
||||
timeout_cb (info->nmc);
|
||||
deactivate_connection_info_finish (info, NULL);
|
||||
return G_SOURCE_REMOVE;
|
||||
|
|
@ -2274,6 +2270,14 @@ down_active_connection_state_cb (NMActiveConnection *active,
|
|||
deactivate_connection_info_finish (info, active);
|
||||
}
|
||||
|
||||
static void
|
||||
destroy_queue_element (gpointer data)
|
||||
{
|
||||
g_signal_handlers_disconnect_matched (data, G_SIGNAL_MATCH_FUNC, 0, 0, 0,
|
||||
down_active_connection_state_cb, NULL);
|
||||
g_object_unref (data);
|
||||
}
|
||||
|
||||
static void
|
||||
deactivate_connection_info_finish (DeactivateConnectionInfo *info,
|
||||
NMActiveConnection *active)
|
||||
|
|
@ -2281,9 +2285,12 @@ deactivate_connection_info_finish (DeactivateConnectionInfo *info,
|
|||
if (active) {
|
||||
info->queue = g_slist_remove (info->queue, active);
|
||||
g_signal_handlers_disconnect_by_func (active,
|
||||
down_active_connection_state_cb,
|
||||
info);
|
||||
down_active_connection_state_cb,
|
||||
info);
|
||||
g_object_unref (active);
|
||||
} else {
|
||||
g_slist_free_full (info->queue, destroy_queue_element);
|
||||
info->queue = NULL;
|
||||
}
|
||||
|
||||
if (info->queue)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue