pidgin/pidgin

Fix a possible leak.

2021-03-04, Elliott Sales de Andrade
afc646d2e7cb
Parents b41d37dbf129
Children 691bd780ab06
Fix a possible leak.

Been failing in scanbuild for a while.

Testing Done:
Compile only. Ran scanbuild again and leak is not reported.

Reviewed at https://reviews.imfreedom.org/r/556/
--- a/pidgin/gtkaccount.c Wed Mar 03 00:06:37 2021 -0600
+++ b/pidgin/gtkaccount.c Thu Mar 04 20:32:36 2021 -0600
@@ -1709,18 +1709,18 @@
pidgin_account_dialog_show(PidginAccountDialogType type, PurpleAccount *account)
{
PurpleCredentialManager *manager = NULL;
- PidginAccountDialogShowData *data = NULL;
-
- /* this is kind of dangerous, but it's no worse than the old version.
- * Regardless this dialog needs a lot of TLC.
- */
- data = g_new0(PidginAccountDialogShowData, 1);
- data->account = account;
- data->type = type;
manager = purple_credential_manager_get_default();
if(PURPLE_IS_ACCOUNT(account)) {
+ /* this is kind of dangerous, but it's no worse than the old version.
+ * Regardless this dialog needs a lot of TLC.
+ */
+ PidginAccountDialogShowData *data = NULL;
+ data = g_new0(PidginAccountDialogShowData, 1);
+ data->account = account;
+ data->type = type;
+
purple_credential_manager_read_password_async(manager, account, NULL,
pidgin_account_dialog_read_password_cb,
data);