Free ProfAccount

This commit is contained in:
James Booth
2016-07-25 22:38:23 +01:00
parent d5d04756ce
commit 8633cd6e29
3 changed files with 5 additions and 1 deletions

View File

@@ -589,9 +589,11 @@ cmd_account_default(ProfWin *window, const char *const command, gchar **args)
}
} else if (g_strv_length(args) == 3) {
if (strcmp(args[1], "set") == 0) {
if (accounts_get_account(args[2])) {
ProfAccount *account_p = accounts_get_account(args[2]);
if (account_p) {
prefs_set_string(PREF_DEFAULT_ACCOUNT, args[2]);
cons_show("Default account set to %s.", args[2]);
account_free(account_p);
} else {
cons_show("Account %s does not exist.", args[2]);
}