From 53142f3d6a65cccba57b1898db07ae33333c1ffa Mon Sep 17 00:00:00 2001 From: "Owen W. Taylor" Date: Mon, 16 Mar 2020 15:58:16 -0400 Subject: [PATCH] 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 (cherry picked from commit 425f628263476208925c271bfa0dcc01ee3c8b5a) --- oci-authenticator/flatpak-oci-authenticator.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/oci-authenticator/flatpak-oci-authenticator.c b/oci-authenticator/flatpak-oci-authenticator.c index d351fc57..d98326ac 100644 --- a/oci-authenticator/flatpak-oci-authenticator.c +++ b/oci-authenticator/flatpak-oci-authenticator.c @@ -496,6 +496,8 @@ handle_request_ref_tokens (FlatpakAuthenticator *authenticator, first_token = get_token_for_ref (registry, ref_data, NULL, &error); if (first_token != NULL) have_auth = TRUE; + else + g_clear_error (&error); } /* Prompt the user for credentials */ @@ -520,6 +522,11 @@ handle_request_ref_tokens (FlatpakAuthenticator *authenticator, auth = g_steal_pointer (&test_auth); have_auth = TRUE; } + else + { + g_debug ("Failed to get token: %s", error->message); + g_clear_error (&error); + } } }