mirror of
https://github.com/profanity-im/profanity.git
synced 2024-11-03 19:37:16 -05:00
fix a potential leak
This commit is contained in:
parent
b1f79b9d35
commit
1264265691
@ -84,7 +84,6 @@ gboolean
|
|||||||
cmd_connect(gchar **args, struct cmd_help_t help)
|
cmd_connect(gchar **args, struct cmd_help_t help)
|
||||||
{
|
{
|
||||||
gboolean result = FALSE;
|
gboolean result = FALSE;
|
||||||
char *def = prefs_get_string(PREF_DEFAULT_ACCOUNT);
|
|
||||||
|
|
||||||
jabber_conn_status_t conn_status = jabber_get_connection_status();
|
jabber_conn_status_t conn_status = jabber_get_connection_status();
|
||||||
|
|
||||||
@ -94,6 +93,7 @@ cmd_connect(gchar **args, struct cmd_help_t help)
|
|||||||
} else {
|
} else {
|
||||||
gchar *opt_keys[] = { "server", "port", NULL };
|
gchar *opt_keys[] = { "server", "port", NULL };
|
||||||
gboolean parsed;
|
gboolean parsed;
|
||||||
|
char *def = prefs_get_string(PREF_DEFAULT_ACCOUNT);
|
||||||
|
|
||||||
GHashTable *options = parse_options(&args[args[0] ? 1 : 0], opt_keys, &parsed);
|
GHashTable *options = parse_options(&args[args[0] ? 1 : 0], opt_keys, &parsed);
|
||||||
if (!parsed) {
|
if (!parsed) {
|
||||||
@ -124,6 +124,8 @@ cmd_connect(gchar **args, struct cmd_help_t help)
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
g_free(def);
|
||||||
|
|
||||||
char *lower = g_utf8_strdown(user, -1);
|
char *lower = g_utf8_strdown(user, -1);
|
||||||
char *jid;
|
char *jid;
|
||||||
|
|
||||||
@ -176,8 +178,6 @@ cmd_connect(gchar **args, struct cmd_help_t help)
|
|||||||
result = TRUE;
|
result = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
g_free(def);
|
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user