summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Williams <dcbw@redhat.com>2014-05-21 14:56:16 -0500
committerDan Williams <dcbw@redhat.com>2014-05-22 11:34:58 -0500
commitb1d2b14922f86cc668bc0cdb52ccfe470cd4395b (patch)
tree5177e16172bebf9daffa585c51c54d6b85cd7187
parent2af30e813a4024965a52d034578d68e6c351b88f (diff)
downloadNetworkManager-b1d2b14922f86cc668bc0cdb52ccfe470cd4395b.tar.gz
core: fix use-after-free in pending action remove debug message
-rw-r--r--src/devices/nm-device.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c
index 69ba364fe4..4c04c1c831 100644
--- a/src/devices/nm-device.c
+++ b/src/devices/nm-device.c
@@ -7794,13 +7794,12 @@ nm_device_remove_pending_action (NMDevice *device, const char *action, gboolean
for (iter = priv->pending_actions; iter; iter = iter->next) {
if (!strcmp (action, iter->data)) {
- g_free (iter->data);
- priv->pending_actions = g_slist_delete_link (priv->pending_actions, iter);
nm_log_dbg (LOGD_DEVICE, "(%s): remove_pending_action (%d): '%s'",
nm_device_get_iface (device),
- count + g_slist_length (iter),
+ count + g_slist_length (iter->next), /* length excluding 'iter' */
action);
-
+ g_free (iter->data);
+ priv->pending_actions = g_slist_delete_link (priv->pending_actions, iter);
if (priv->pending_actions == NULL)
g_object_notify (G_OBJECT (device), NM_DEVICE_HAS_PENDING_ACTION);
return TRUE;