about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/command/cmd_funcs.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/command/cmd_funcs.c b/src/command/cmd_funcs.c
index 2c68cd1f..9b2622e7 100644
--- a/src/command/cmd_funcs.c
+++ b/src/command/cmd_funcs.c
@@ -3606,7 +3606,7 @@ cmd_join(ProfWin *window, const char *const command, gchar **args)
 
     // full room jid supplied (room@server)
     if (room_arg->localpart) {
-        room = args[0];
+        room = g_strdup(args[0]);
 
     // server not supplied (room), use account preference
     } else if (account->muc_service) {
@@ -3631,6 +3631,7 @@ cmd_join(ProfWin *window, const char *const command, gchar **args)
     if (!parsed) {
         cons_bad_cmd_usage(command);
         cons_show("");
+        g_free(room);
         jid_destroy(room_arg);
         return TRUE;
     }
@@ -3657,6 +3658,7 @@ cmd_join(ProfWin *window, const char *const command, gchar **args)
         ui_switch_to_room(room);
     }
 
+    g_free(room);
     jid_destroy(room_arg);
     account_free(account);