about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorJames Booth <boothj5@gmail.com>2015-01-14 22:02:45 +0000
committerJames Booth <boothj5@gmail.com>2015-01-14 22:02:45 +0000
commitee14e8d05ea0c0869897945f52e724284be7675c (patch)
tree2756e1514cb87ecf120f6ed202bbe24a5b9e004e /src
parent5cf7ef0b4f214884136b15ecad7ce860659f03b4 (diff)
parentdc43cc602c461ce449af1d428404150eeab8cb24 (diff)
downloadprofani-tty-ee14e8d05ea0c0869897945f52e724284be7675c.tar.gz
Merge remote-tracking branch 'incertia/fixleak'
Diffstat (limited to 'src')
-rw-r--r--src/command/commands.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/command/commands.c b/src/command/commands.c
index 98fe72e4..75a4f6cf 100644
--- a/src/command/commands.c
+++ b/src/command/commands.c
@@ -138,6 +138,7 @@ cmd_connect(gchar **args, struct cmd_help_t help)
                 // Evaluate as shell command to retrieve password
                 GString *cmd = g_string_append(g_string_new(account->eval_password), " 2>/dev/null");
                 FILE *stream = popen(cmd->str, "r");
+                g_string_free(cmd, TRUE);
                 if(stream){
                     // Limit to READ_BUF_SIZE bytes to prevent overflows in the case of a poorly chosen command
                     account->password = g_malloc(READ_BUF_SIZE);
@@ -158,7 +159,6 @@ cmd_connect(gchar **args, struct cmd_help_t help)
                     cons_show("Error evaluating password, see logs for details.");
                     return TRUE;
                 }
-                g_string_free(cmd, TRUE);
             } else if (!account->password) {
                 account->password = ui_ask_password();
             }