From 8633cd6e29a74c86f13b7471f7d857f9ac9efe50 Mon Sep 17 00:00:00 2001 From: James Booth Date: Mon, 25 Jul 2016 22:38:23 +0100 Subject: Free ProfAccount --- src/command/cmd_funcs.c | 4 +++- src/xmpp/bookmark.c | 1 + src/xmpp/session.c | 1 + 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/command/cmd_funcs.c b/src/command/cmd_funcs.c index 26b22c4f..342d38d5 100644 --- a/src/command/cmd_funcs.c +++ b/src/command/cmd_funcs.c @@ -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]); } diff --git a/src/xmpp/bookmark.c b/src/xmpp/bookmark.c index 940b7982..f6a41553 100644 --- a/src/xmpp/bookmark.c +++ b/src/xmpp/bookmark.c @@ -191,6 +191,7 @@ bookmark_join(const char *jid) account_free(account); } else if (muc_roster_complete(item->jid)) { ui_room_join(item->jid, TRUE); + account_free(account); } return TRUE; } diff --git a/src/xmpp/session.c b/src/xmpp/session.c index 9fe448f8..139d2fdb 100644 --- a/src/xmpp/session.c +++ b/src/xmpp/session.c @@ -498,6 +498,7 @@ _session_reconnect(void) log_debug("Attempting reconnect with account %s", account->name); connection_connect(fulljid, saved_account.passwd, account->server, account->port, account->tls_policy); free(fulljid); + account_free(account); g_timer_start(reconnect_timer); } -- cgit 1.4.1-2-gfad0