diff options
author | Will Song <incertia9474@gmail.com> | 2015-01-12 23:00:03 -0600 |
---|---|---|
committer | Will Song <incertia9474@gmail.com> | 2015-01-12 23:00:03 -0600 |
commit | 12642656917ed3d33e1a82683c09d2136b8b01b1 (patch) | |
tree | 628d18ebb7acf7f602bea1e8aecb930ea68c08ea | |
parent | b1f79b9d35a7d9b1ce2f782714020f14ce78b561 (diff) | |
download | profani-tty-12642656917ed3d33e1a82683c09d2136b8b01b1.tar.gz |
fix a potential leak
-rw-r--r-- | src/command/commands.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/command/commands.c b/src/command/commands.c index d6a8af2f..2f61b6fa 100644 --- a/src/command/commands.c +++ b/src/command/commands.c @@ -84,7 +84,6 @@ gboolean cmd_connect(gchar **args, struct cmd_help_t help) { gboolean result = FALSE; - char *def = prefs_get_string(PREF_DEFAULT_ACCOUNT); jabber_conn_status_t conn_status = jabber_get_connection_status(); @@ -94,6 +93,7 @@ cmd_connect(gchar **args, struct cmd_help_t help) } else { gchar *opt_keys[] = { "server", "port", NULL }; gboolean parsed; + char *def = prefs_get_string(PREF_DEFAULT_ACCOUNT); GHashTable *options = parse_options(&args[args[0] ? 1 : 0], opt_keys, &parsed); if (!parsed) { @@ -124,6 +124,8 @@ cmd_connect(gchar **args, struct cmd_help_t help) return TRUE; } } + g_free(def); + char *lower = g_utf8_strdown(user, -1); char *jid; @@ -176,8 +178,6 @@ cmd_connect(gchar **args, struct cmd_help_t help) result = TRUE; } - g_free(def); - return result; } |