From ecf3677e57bce2195ea585eb6aa2cf7188ed6de8 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Mon, 5 Feb 2018 20:43:08 +0100 Subject: [PATCH] device: clear priv->queued_act_request before setting state Setting the state of NMActiveConnection results in invoking callbacks in NMManager. Hence, it might be far-reaching. Clear priv->queued_act_request before invoking the callbacks. --- src/devices/nm-device.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c index dbc3788316..d817d7922e 100644 --- a/src/devices/nm-device.c +++ b/src/devices/nm-device.c @@ -10071,10 +10071,12 @@ static void _clear_queued_act_request (NMDevicePrivate *priv) { if (priv->queued_act_request) { - nm_active_connection_set_state_fail ((NMActiveConnection *) priv->queued_act_request, + gs_unref_object NMActRequest *ac = NULL; + + ac = g_steal_pointer (&priv->queued_act_request); + nm_active_connection_set_state_fail ((NMActiveConnection *) ac, NM_ACTIVE_CONNECTION_STATE_REASON_DEVICE_DISCONNECTED, NULL); - g_clear_object (&priv->queued_act_request); } }