about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorDmitry Podgorny <pasis.ua@gmail.com>2013-01-07 21:21:19 +0200
committerDmitry Podgorny <pasis.ua@gmail.com>2013-01-07 21:21:19 +0200
commit621832ee4a621f82f4bd693e7c7bf52944c3671a (patch)
tree35aa0f23995d5987c48f64e06c3aba55c054b820
parent59676bd16e69c37b07a12c4f2a3296195f9e1d76 (diff)
downloadprofani-tty-621832ee4a621f82f4bd693e7c7bf52944c3671a.tar.gz
free resources when login attempt fails
The next call of jabber_connect allocates these resources again.
-rw-r--r--src/jabber.c10
1 files changed, 1 insertions, 9 deletions
diff --git a/src/jabber.c b/src/jabber.c
index fb558020..8d2dc572 100644
--- a/src/jabber.c
+++ b/src/jabber.c
@@ -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) {