summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBeniamino Galvani <bgalvani@redhat.com>2016-12-23 14:02:58 +0100
committerBeniamino Galvani <bgalvani@redhat.com>2016-12-23 14:20:15 +0100
commit8adbeb821ea6f82c1f4df57eb34cc1834a429343 (patch)
tree82277d51a7af070fd21a90b6d6bd3efc70ac38cf
parent30a1e17cc032676cdfb04e2abcfab9db0d0cf085 (diff)
downloadNetworkManager-8adbeb821ea6f82c1f4df57eb34cc1834a429343.tar.gz
manager: better handle failures in AddAndActivateConnection
nm_settings_add_connection_dbus() invokes the activation_add_done() callback with a NULL @new_connection in case of error: add a check to prevent a crash.
-rw-r--r--src/nm-manager.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/nm-manager.c b/src/nm-manager.c
index feca5a8de9..f35c485d97 100644
--- a/src/nm-manager.c
+++ b/src/nm-manager.c
@@ -3673,7 +3673,8 @@ activation_add_done (NMSettings *settings,
g_assert (error);
_internal_activation_failed (self, active, error->message);
- nm_settings_connection_delete (new_connection, NULL, NULL);
+ if (new_connection)
+ nm_settings_connection_delete (new_connection, NULL, NULL);
g_dbus_method_invocation_return_gerror (context, error);
nm_audit_log_connection_op (NM_AUDIT_OP_CONN_ADD_ACTIVATE,
NULL,