about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorWill Song <incertia9474@gmail.com>2015-01-14 11:10:14 -0600
committerWill Song <incertia9474@gmail.com>2015-01-14 11:10:14 -0600
commitdc43cc602c461ce449af1d428404150eeab8cb24 (patch)
tree93791dd6b3989c5925f0985f95b5fc0a06dd255e
parentb5d4a52dfa6386461af55c93b934fc2af5acc6ea (diff)
downloadprofani-tty-dc43cc602c461ce449af1d428404150eeab8cb24.tar.gz
fix yet another potential leak
-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 9fd6eed4..2a22f323 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();
             }