device: assert for valid device argument in nm_device_remove_pending_action()

Coverity complains in nm-active-connection.c:

   996        if (priv->pending_activation_id) {
      CID 59368 (#1 of 1): Dereference after null check (FORWARD_NULL)4. var_deref_model: Passing null pointer priv->device to nm_device_remove_pending_action, which dereferences it. [show details]
   997                nm_device_remove_pending_action (priv->device, priv->pending_activation_id, TRUE);
   998                g_clear_pointer (&priv->pending_activation_id, g_free);
   999        }
This commit is contained in:
Thomas Haller 2016-03-04 08:46:51 +01:00
parent 1bf76b784f
commit 2d6cf0df19

View file

@ -9838,12 +9838,15 @@ nm_device_add_pending_action (NMDevice *self, const char *action, gboolean asser
gboolean
nm_device_remove_pending_action (NMDevice *self, const char *action, gboolean assert_is_pending)
{
NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (self);
NMDevicePrivate *priv;
GSList *iter, *next;
guint count = 0;
g_return_val_if_fail (self, FALSE);
g_return_val_if_fail (action, FALSE);
priv = NM_DEVICE_GET_PRIVATE (self);
for (iter = priv->pending_actions; iter; iter = next) {
next = iter->next;
if (!strcmp (action, iter->data)) {