mirror of
https://github.com/profanity-im/profanity.git
synced 2025-02-02 15:08:15 -05:00
Merge pull request #1047 from paulfariello/hotfix/1046
Avoid use after free on default account
This commit is contained in:
commit
6b064cfde4
@ -387,6 +387,7 @@ cmd_connect(ProfWin *window, const char *const command, gchar **args)
|
|||||||
}
|
}
|
||||||
|
|
||||||
char *jid;
|
char *jid;
|
||||||
|
user = strdup(user);
|
||||||
g_free(def);
|
g_free(def);
|
||||||
|
|
||||||
// connect with account
|
// connect with account
|
||||||
@ -413,7 +414,6 @@ cmd_connect(ProfWin *window, const char *const command, gchar **args)
|
|||||||
account->password = NULL;
|
account->password = NULL;
|
||||||
} else {
|
} else {
|
||||||
cons_show("Error evaluating password, see logs for details.");
|
cons_show("Error evaluating password, see logs for details.");
|
||||||
g_free(user);
|
|
||||||
account_free(account);
|
account_free(account);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
@ -444,6 +444,7 @@ cmd_connect(ProfWin *window, const char *const command, gchar **args)
|
|||||||
|
|
||||||
options_destroy(options);
|
options_destroy(options);
|
||||||
free(jid);
|
free(jid);
|
||||||
|
free(user);
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user