1
0
mirror of https://github.com/profanity-im/profanity.git synced 2024-12-04 14:46:46 -05:00

Merge pull request #1047 from paulfariello/hotfix/1046

Avoid use after free on default account
This commit is contained in:
Michael Vetter 2019-04-08 11:44:16 +02:00 committed by GitHub
commit 6b064cfde4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -387,6 +387,7 @@ cmd_connect(ProfWin *window, const char *const command, gchar **args)
}
char *jid;
user = strdup(user);
g_free(def);
// connect with account
@ -413,7 +414,6 @@ cmd_connect(ProfWin *window, const char *const command, gchar **args)
account->password = NULL;
} else {
cons_show("Error evaluating password, see logs for details.");
g_free(user);
account_free(account);
return TRUE;
}
@ -444,6 +444,7 @@ cmd_connect(ProfWin *window, const char *const command, gchar **args)
options_destroy(options);
free(jid);
free(user);
return TRUE;
}