core: fix freeing pending activations in dispose() of device

activate_data_free() deletes the data from priv->pending_activation_checks,
thus iterating over the list with g_slist_free_full() causes a double
free or invalid memory access.

This bug does not hit easily, because the policy only get's disposed
when NM shuts down and then there are likely no pending activations
queued.

Fixes regression introduced by commit 4f0c70e945.

Signed-off-by: Thomas Haller <thaller@redhat.com>
This commit is contained in:
Thomas Haller 2014-04-09 14:05:08 +02:00
parent 3c211760c5
commit 58500b3b8b

View file

@ -2165,8 +2165,8 @@ dispose (GObject *object)
g_clear_object (&priv->lookup_addr);
g_clear_object (&priv->resolver);
g_slist_free_full (priv->pending_activation_checks, (GDestroyNotify) activate_data_free);
priv->pending_activation_checks = NULL;
while (priv->pending_activation_checks)
activate_data_free (priv->pending_activation_checks->data);
g_slist_free_full (priv->pending_secondaries, (GDestroyNotify) pending_secondary_data_free);
priv->pending_secondaries = NULL;