mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-01-06 12:00:17 +01:00
tui: fix crash during activation when failed to create secret-agent
NetworkManager only allows one 'client:user-id' to register as secret
agent. Thus, when starting nmtui in two terminals, creating the secret
agent can fail.
This can lead to a crash.
https://bugzilla.gnome.org/show_bug.cgi?id=755883
(cherry picked from commit b861900d45)
This commit is contained in:
parent
3f08333847
commit
269a4483be
1 changed files with 4 additions and 4 deletions
|
|
@ -132,7 +132,7 @@ activate_connection (NMConnection *connection,
|
|||
NMObject *specific_object)
|
||||
{
|
||||
NmtNewtForm *form;
|
||||
NMSecretAgentOld *agent;
|
||||
gs_unref_object NMSecretAgentOld *agent = NULL;
|
||||
NmtNewtWidget *label;
|
||||
NmtSyncOp op;
|
||||
const char *specific_object_path;
|
||||
|
|
@ -188,7 +188,7 @@ activate_connection (NMConnection *connection,
|
|||
goto done;
|
||||
}
|
||||
|
||||
if (!connection) {
|
||||
if (agent && !connection) {
|
||||
connection = NM_CONNECTION (nm_active_connection_get_connection (ac));
|
||||
if (connection) {
|
||||
nm_secret_agent_simple_enable (NM_SECRET_AGENT_SIMPLE (agent),
|
||||
|
|
@ -220,8 +220,8 @@ activate_connection (NMConnection *connection,
|
|||
nmt_newt_form_quit (form);
|
||||
g_object_unref (form);
|
||||
|
||||
nm_secret_agent_old_unregister (agent, NULL, NULL);
|
||||
g_object_unref (agent);
|
||||
if (agent)
|
||||
nm_secret_agent_old_unregister (agent, NULL, NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue