network: close settings prior to network removal

station_hide_network will remove and free the network object, so calling
network_close_settings will result in a crash.  Make sure this is done
prior to network object's destruction.

Fixes: 85d9d6461f ("network: Hide hidden networks on connection error")
This commit is contained in:
Denis Kenzior 2022-04-08 11:23:28 -05:00
parent c5f44f8d38
commit 867c68c05b
1 changed files with 2 additions and 2 deletions

View File

@ -1248,10 +1248,10 @@ static void passphrase_callback(enum agent_result result,
return;
err:
network_settings_close(network);
if (network->provisioning_hidden)
station_hide_network(station, network);
network_settings_close(network);
}
static struct l_dbus_message *network_connect_psk(struct network *network,