mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-02-09 06:10:29 +01:00
core: ensure dhcp_manager exists before trying to unref it (bgo #626610)
If a new device wasn't supported, it gets destroyed by the NMDevice constructor() method. But in the constructor paths the DHCP manager isn't created yet, and so we attempt to unref a non-existent DHCP manager. Usually just a harmless warning, but apparently a crash sometimes.
This commit is contained in:
parent
a4e6519d11
commit
96a9ce41fb
1 changed files with 2 additions and 1 deletions
|
|
@ -3375,7 +3375,8 @@ finalize (GObject *object)
|
|||
NMDevice *self = NM_DEVICE (object);
|
||||
NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (self);
|
||||
|
||||
g_object_unref (priv->dhcp_manager);
|
||||
if (priv->dhcp_manager)
|
||||
g_object_unref (priv->dhcp_manager);
|
||||
|
||||
g_free (priv->udi);
|
||||
g_free (priv->iface);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue