about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--src/command/cmd_funcs.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/command/cmd_funcs.c b/src/command/cmd_funcs.c
index d280e6c8..b2f0ee7f 100644
--- a/src/command/cmd_funcs.c
+++ b/src/command/cmd_funcs.c
@@ -387,6 +387,7 @@ cmd_connect(ProfWin *window, const char *const command, gchar **args)
     }
 
     char *jid;
+    user = strdup(user);
     g_free(def);
 
     // connect with account
@@ -413,7 +414,6 @@ cmd_connect(ProfWin *window, const char *const command, gchar **args)
                 account->password = NULL;
             } else {
                 cons_show("Error evaluating password, see logs for details.");
-                g_free(user);
                 account_free(account);
                 return TRUE;
             }
@@ -444,6 +444,7 @@ cmd_connect(ProfWin *window, const char *const command, gchar **args)
 
     options_destroy(options);
     free(jid);
+    free(user);
 
     return TRUE;
 }