exit with non-zero status code if account not loaded; close
@@ -24,10 +24,9 @@ int main(int argc, char** argv) {
}
#endif
- if (arguments.args[0]) {
char* scope_str = listToDelimitedString(arguments.scopes, " ");
- struct token_response (*getTokenResponseFnc)(
- const char*, time_t, const char*, const char*, const char*) =
+ struct token_response (*getTokenResponseFnc)(const char*, time_t, const char*,
+ const char*, const char*) =
getTokenResponse3;
unsigned char useIssuerInsteadOfShortname = 0;
if (strstarts(arguments.args[0], "https://")) {
@@ -53,7 +52,9 @@ int main(int argc, char** argv) {
if (response.token == NULL) {
// fprintf(stderr, "Error: %s\n", oidcagent_serror());
oidcagent_perror();
- } else {
+ secFreeTokenResponse(response);
+ exit(EXIT_FAILURE);
+ }
if (arguments.printAll) {
printf("%s\n", response.token);
printf("%s\n", response.issuer);
@@ -89,9 +90,7 @@ int main(int argc, char** argv) {
}
}
}
- }
secFreeTokenResponse(response);
- }
if (arguments.scopes) {
list_destroy(arguments.scopes);
}
