mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-01-01 06:00:12 +01:00
core: fix leak of generated connection if device is active
Don't generate (and add to settings) a connection if we aren't going to use it anyway.
This commit is contained in:
parent
5dd48f7527
commit
3cf2fbbf47
1 changed files with 4 additions and 5 deletions
|
|
@ -1656,6 +1656,10 @@ recheck_assume_connection (NMDevice *device, gpointer user_data)
|
|||
if (nm_device_get_unmanaged_flag (device, NM_UNMANAGED_USER))
|
||||
return FALSE;
|
||||
|
||||
state = nm_device_get_state (device);
|
||||
if (state > NM_DEVICE_STATE_DISCONNECTED)
|
||||
return FALSE;
|
||||
|
||||
connection = get_existing_connection (self, device, &generated);
|
||||
if (!connection) {
|
||||
nm_log_dbg (LOGD_DEVICE, "(%s): can't assume; no connection",
|
||||
|
|
@ -1663,11 +1667,6 @@ recheck_assume_connection (NMDevice *device, gpointer user_data)
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
state = nm_device_get_state (device);
|
||||
|
||||
if (state > NM_DEVICE_STATE_DISCONNECTED)
|
||||
return FALSE;
|
||||
|
||||
if (state == NM_DEVICE_STATE_UNMANAGED) {
|
||||
was_unmanaged = TRUE;
|
||||
nm_device_state_changed (device,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue