about summary refs log tree commit diff
path: root/src/settings/nm-settings.c
diff options
context:
space:
mode:
authorMichael Biebl <biebl@debian.org>2018-03-13 01:30:38 +0100
committerMichael Biebl <biebl@debian.org>2018-03-13 01:30:38 +0100
commitbd71023d735a1dd11b1da3779850df573f134ad1 (patch)
treee53ddb1bdc1f700b61377ec8a264cfce40515488 /src/settings/nm-settings.c
parentd0408a3e3b1cc6effec321d098008ef0c4acf91b (diff)
parent7e9ff09fcb2366b383b7ebbec80d2f6fff117290 (diff)
Update upstream source from tag 'upstream/1.10.6'
Update to upstream version '1.10.6'
with Debian dir c37b318f40a9e6c07a543a8093e311df21e75045
Diffstat (limited to 'src/settings/nm-settings.c')
-rw-r--r--src/settings/nm-settings.c25
1 files changed, 10 insertions, 15 deletions
diff --git a/src/settings/nm-settings.c b/src/settings/nm-settings.c
index 51b7bea7..8e3fc582 100644
--- a/src/settings/nm-settings.c
+++ b/src/settings/nm-settings.c
@@ -1337,7 +1337,7 @@ impl_settings_add_connection_helper (NMSettings *self,
                                      GVariant *settings,
                                      gboolean save_to_disk)
 {
-	NMConnection *connection;
+	gs_unref_object NMConnection *connection = NULL;
 	GError *error = NULL;
 
 	connection = _nm_simple_connection_new_from_dbus (settings,
@@ -1345,23 +1345,18 @@ impl_settings_add_connection_helper (NMSettings *self,
 	                                                  | NM_SETTING_PARSE_FLAGS_NORMALIZE,
 	                                                  &error);
 
-	if (connection) {
-		if (!nm_connection_verify_secrets (connection, &error))
-			goto failure;
-
-		nm_settings_add_connection_dbus (self,
-		                                 connection,
-		                                 save_to_disk,
-		                                 context,
-		                                 impl_settings_add_connection_add_cb,
-		                                 NULL);
-		g_object_unref (connection);
+	if (   !connection
+	    || !nm_connection_verify_secrets (connection, &error)) {
+		g_dbus_method_invocation_take_error (context, error);
 		return;
 	}
 
-failure:
-	g_assert (error);
-	g_dbus_method_invocation_take_error (context, error);
+	nm_settings_add_connection_dbus (self,
+	                                 connection,
+	                                 save_to_disk,
+	                                 context,
+	                                 impl_settings_add_connection_add_cb,
+	                                 NULL);
 }
 
 static void