about summary refs log tree commit diff stats
path: root/src/command
diff options
context:
space:
mode:
authorPaul Fariello <paul@fariello.eu>2019-04-08 11:20:12 +0200
committerPaul Fariello <paul@fariello.eu>2019-04-08 11:20:14 +0200
commitaa9dcf7b3a7434f1807c625c2afe834524ba7c8e (patch)
treecd9071cb092e912d9551a0440adfa2e18bf541d6 /src/command
parentf7cb40ecf0b53a706875f1223dc99cf6481c3618 (diff)
downloadprofani-tty-aa9dcf7b3a7434f1807c625c2afe834524ba7c8e.tar.gz
Avoid use after free on default account
Fix 1046
Diffstat (limited to 'src/command')
-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;
 }
3 +0000 committer James Booth <boothj5@gmail.com> 2015-02-05 00:58:23 +0000 Moved command processing to main loop, allow resize during password prompt' href='/danisanti/profani-tty/commit/src/ui/inputwin.h?id=a70aa0255fc438894e563f80dfb4ab88278a1118'>a70aa025 ^
2ce43b63 ^
9aa282f6 ^
c7ff3255 ^
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49