mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-05-06 05:38:15 +02:00
core: fix use-after-free in pending action remove debug message
This commit is contained in:
parent
2af30e813a
commit
b1d2b14922
1 changed files with 3 additions and 4 deletions
|
|
@ -7794,13 +7794,12 @@ nm_device_remove_pending_action (NMDevice *device, const char *action, gboolean
|
||||||
|
|
||||||
for (iter = priv->pending_actions; iter; iter = iter->next) {
|
for (iter = priv->pending_actions; iter; iter = iter->next) {
|
||||||
if (!strcmp (action, iter->data)) {
|
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_log_dbg (LOGD_DEVICE, "(%s): remove_pending_action (%d): '%s'",
|
||||||
nm_device_get_iface (device),
|
nm_device_get_iface (device),
|
||||||
count + g_slist_length (iter),
|
count + g_slist_length (iter->next), /* length excluding 'iter' */
|
||||||
action);
|
action);
|
||||||
|
g_free (iter->data);
|
||||||
|
priv->pending_actions = g_slist_delete_link (priv->pending_actions, iter);
|
||||||
if (priv->pending_actions == NULL)
|
if (priv->pending_actions == NULL)
|
||||||
g_object_notify (G_OBJECT (device), NM_DEVICE_HAS_PENDING_ACTION);
|
g_object_notify (G_OBJECT (device), NM_DEVICE_HAS_PENDING_ACTION);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue