oci-authenticator: fix failures to clear GError

Fix problems overwriting a GError when we retry multiple times.
One of these was introduced with the recent change
e3f17a89a flatpak-oci-authenticator: try getting a token without credentials
but the other was existing.

Signed-off-by: Owen W. Taylor <otaylor@fishsoup.net>
This commit is contained in:
Owen W. Taylor committed 2020-03-16 15:59:21 -04:00
1 parent fc8a6f0681
commit 425f628263
1 file changed
+7
@@ -496,6 +496,8 @@ handle_request_ref_tokens (FlatpakAuthenticator *f_authenticator,
token = get_token_for_ref (registry, ref_data, NULL, &error);
if (token != NULL)
have_auth = TRUE;
else
g_clear_error (&error);
}
/* Prompt the user for credentials */
@@ -521,6 +523,11 @@ handle_request_ref_tokens (FlatpakAuthenticator *f_authenticator,
auth = g_steal_pointer (&test_auth);
have_auth = TRUE;
}
else
{
g_debug ("Failed to get token: %s", error->message);
g_clear_error (&error);
}
}
}