wifi: Fix invalid variant unref in connection editor
If the WiFi secret is not set, then a NULL variant is passed back. We should not free this variant. Fix this by using g_autoptr instead.
This commit is contained in:
parent
6fc89e8e8d
commit
417624cdab
1 changed files with 3 additions and 5 deletions
|
@ -448,20 +448,18 @@ get_secrets_cb (GObject *source_object,
|
||||||
{
|
{
|
||||||
NMRemoteConnection *connection;
|
NMRemoteConnection *connection;
|
||||||
GetSecretsInfo *info = user_data;
|
GetSecretsInfo *info = user_data;
|
||||||
GError *error = NULL;
|
g_autoptr(GError) error = NULL;
|
||||||
GVariant *variant;
|
g_autoptr(GVariant) variant = NULL;
|
||||||
|
|
||||||
connection = NM_REMOTE_CONNECTION (source_object);
|
connection = NM_REMOTE_CONNECTION (source_object);
|
||||||
variant = nm_remote_connection_get_secrets_finish (connection, res, &error);
|
variant = nm_remote_connection_get_secrets_finish (connection, res, &error);
|
||||||
|
|
||||||
if (!variant && g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) {
|
if (!variant && g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) {
|
||||||
g_error_free (error);
|
|
||||||
g_free (info);
|
g_free (info);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
ce_page_complete_init (info->page, info->setting_name, variant, error);
|
ce_page_complete_init (info->page, info->setting_name, variant, g_steal_pointer (&error));
|
||||||
g_variant_unref (variant);
|
|
||||||
g_free (info);
|
g_free (info);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue