ovs: don't leak a GCancellable on connection failure

Every time we clear priv->client we should also clear the cancellable
or it will be leaked.

Fixes: 830a5a14cb
(cherry picked from commit b92f2c9323)
This commit is contained in:
Beniamino Galvani 2019-02-10 13:41:37 +01:00
parent 35c101011d
commit 9d291821f2

View file

@ -1309,6 +1309,7 @@ ovsdb_disconnect (NMOvsdb *self, gboolean is_disposing)
g_clear_object (&priv->client);
g_clear_object (&priv->conn);
g_clear_pointer (&priv->db_uuid, g_free);
nm_clear_g_cancellable (&priv->cancellable);
}
static void
@ -1541,9 +1542,6 @@ dispose (GObject *object)
g_clear_pointer (&priv->ports, g_hash_table_destroy);
g_clear_pointer (&priv->interfaces, g_hash_table_destroy);
g_cancellable_cancel (priv->cancellable);
g_clear_object (&priv->cancellable);
G_OBJECT_CLASS (nm_ovsdb_parent_class)->dispose (object);
}