core/dhcp: fix dispose() of NMDHCPClient to handle multiple invocations
Signed-off-by: Thomas Haller <thaller@redhat.com>
This commit is contained in:
@@ -1565,16 +1565,26 @@ dispose (GObject *object)
|
|||||||
* the DHCP client.
|
* the DHCP client.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (priv->remove_id)
|
if (priv->remove_id) {
|
||||||
g_source_remove (priv->remove_id);
|
g_source_remove (priv->remove_id);
|
||||||
|
priv->remove_id = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (priv->options) {
|
||||||
g_hash_table_destroy (priv->options);
|
g_hash_table_destroy (priv->options);
|
||||||
g_free (priv->iface);
|
priv->options = NULL;
|
||||||
if (priv->hwaddr)
|
}
|
||||||
g_byte_array_free (priv->hwaddr, TRUE);
|
g_clear_pointer (&priv->iface, g_free);
|
||||||
|
|
||||||
if (priv->duid)
|
if (priv->hwaddr) {
|
||||||
|
g_byte_array_free (priv->hwaddr, TRUE);
|
||||||
|
priv->hwaddr = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (priv->duid) {
|
||||||
g_byte_array_free (priv->duid, TRUE);
|
g_byte_array_free (priv->duid, TRUE);
|
||||||
|
priv->duid = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
G_OBJECT_CLASS (nm_dhcp_client_parent_class)->dispose (object);
|
G_OBJECT_CLASS (nm_dhcp_client_parent_class)->dispose (object);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user