1
0
mirror of https://github.com/profanity-im/profanity.git synced 2024-12-04 14:46:46 -05:00

Free saved account details before replacing

This commit is contained in:
James Booth 2014-06-15 21:00:01 +01:00
parent d181f500ea
commit d6d714e1ed

View File

@ -117,7 +117,13 @@ _jabber_connect_with_account(const ProfAccount * const account)
log_info("Connecting using account: %s", account->name);
// save account name and password for reconnect
if (saved_account.name != NULL) {
free(saved_account.name);
}
saved_account.name = strdup(account->name);
if (saved_account.passwd != NULL) {
free(saved_account.passwd);
}
saved_account.passwd = strdup(account->password);
// connect with fulljid