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

free resources when login attempt fails

The next call of jabber_connect allocates these resources again.
This commit is contained in:
Dmitry Podgorny 2013-01-07 21:21:19 +02:00
parent 59676bd16e
commit 621832ee4a

View File

@ -804,17 +804,9 @@ _connection_handler(xmpp_conn_t * const conn,
} else {
if (reconnect_timer == NULL) {
prof_handle_failed_login();
if (saved_user != NULL) {
free(saved_user);
saved_user = NULL;
}
if (saved_password != NULL) {
free(saved_password);
saved_password = NULL;
}
xmpp_stop(ctx);
jabber_conn.conn_status = JABBER_DISCONNECTED;
jabber_conn.presence = PRESENCE_OFFLINE;
jabber_free_resources();
} else {
xmpp_stop(ctx);
if (prefs_get_reconnect() != 0) {