fixes seg fault if max pass try reached
@@ -267,6 +267,10 @@ struct oidc_account* genNewAccount(struct oidc_account* account,
secFree(prompt);
loaded_p = decryptAccount(shortname, encryptionPassword);
}
+ if (loaded_p == NULL) {
+ secFree(encryptionPassword);
+ exit(EXIT_FAILURE);
+ }
secFreeAccount(account);
account = loaded_p;
} else {
@@ -454,6 +458,9 @@ void handleDelete(struct arguments arguments) {
loaded_p = decryptAccount(arguments.args[0], encryptionPassword);
secFree(encryptionPassword);
}
+ if (loaded_p == NULL) {
+ return;
+ }
char* json = accountToJSONString(*loaded_p);
secFreeAccount(loaded_p);
deleteClient(arguments.args[0], json, 1);
