Fix redefinition of local variable in gio/gdbusauthmechanismsha1.c

This commit is contained in:
Loic Le Page 2022-01-19 18:30:29 +01:00 committed by Loïc Le Page
parent c2b60e0323
commit eb157bfa1b

View File

@ -660,7 +660,7 @@ keyring_generate_entry (const gchar *cookie_context,
gchar *keyring_dir;
gchar *path;
gchar *contents;
GError *local_error;
GError *local_error = NULL;
gchar **lines;
gint max_line_id;
GString *new_contents;
@ -696,7 +696,6 @@ keyring_generate_entry (const gchar *cookie_context,
if (lock_fd == -1)
goto out;
local_error = NULL;
contents = NULL;
if (!g_file_get_contents (path,
&contents,
@ -706,12 +705,12 @@ keyring_generate_entry (const gchar *cookie_context,
if (local_error->domain == G_FILE_ERROR && local_error->code == G_FILE_ERROR_NOENT)
{
/* file doesn't have to exist */
g_error_free (local_error);
g_clear_error (&local_error);
}
else
{
g_propagate_prefixed_error (error,
local_error,
g_steal_pointer (&local_error),
_("Error opening keyring “%s” for writing: "),
path);
goto out;
@ -890,11 +889,11 @@ keyring_generate_entry (const gchar *cookie_context,
}
out:
/* Any error should have been propagated to @error by now */
g_assert (local_error == NULL);
if (lock_fd != -1)
{
GError *local_error;
local_error = NULL;
if (!keyring_release_lock (path, lock_fd, &local_error))
{
if (error != NULL)