mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-04-17 16:10:44 +02:00
device: copy the plink instance before realize_start_setup()
To make sure, we don't end up with a dangling pointer due to an intermediate platform access which may invalidate the pointer.
This commit is contained in:
parent
2cb18efaea
commit
f04baa63c0
1 changed files with 6 additions and 0 deletions
|
|
@ -1955,6 +1955,8 @@ nm_device_realize_start (NMDevice *self,
|
|||
gboolean *out_compatible,
|
||||
GError **error)
|
||||
{
|
||||
NMPlatformLink plink_copy;
|
||||
|
||||
NM_SET_OUT (out_compatible, TRUE);
|
||||
|
||||
if (plink) {
|
||||
|
|
@ -1969,6 +1971,10 @@ nm_device_realize_start (NMDevice *self,
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
if (plink) {
|
||||
plink_copy = *plink;
|
||||
plink = &plink_copy;
|
||||
}
|
||||
realize_start_setup (self, plink);
|
||||
|
||||
return TRUE;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue