network: Use g_autoptr for GError handling

This commit is contained in:
Robert Ancell 2019-09-12 10:54:37 +12:00
parent 072d5daf5c
commit 01190db349
18 changed files with 73 additions and 135 deletions

View file

@ -76,12 +76,10 @@ activate_existing_cb (GObject *source_object,
GAsyncResult *res,
gpointer user_data)
{
GError *error = NULL;
g_autoptr(GError) error = NULL;
if (!nm_client_activate_connection_finish (NM_CLIENT (source_object), res, &error)) {
if (!nm_client_activate_connection_finish (NM_CLIENT (source_object), res, &error))
g_warning ("Failed to activate connection: (%d) %s", error->code, error->message);
g_error_free (error);
}
}
static void
@ -89,12 +87,10 @@ activate_new_cb (GObject *source_object,
GAsyncResult *res,
gpointer user_data)
{
GError *error = NULL;
g_autoptr(GError) error = NULL;
if (!nm_client_add_and_activate_connection_finish (NM_CLIENT (source_object), res, &error)) {
if (!nm_client_add_and_activate_connection_finish (NM_CLIENT (source_object), res, &error))
g_warning ("Failed to add new connection: (%d) %s", error->code, error->message);
g_error_free (error);
}
}
static void