Skip to content

Commit

Permalink
oci-authenticator: fix failures to clear GError
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
owtaylor committed Mar 16, 2020
1 parent fc8a6f0 commit 425f628
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions oci-authenticator/flatpak-oci-authenticator.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand All @@ -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);
}
}
}

Expand Down

0 comments on commit 425f628

Please sign in to comment.