mirror of
https://github.com/profanity-im/profanity.git
synced 2024-12-04 14:46:46 -05:00
Fix crash on reconnection in the chat window
Profanity tries to access the nickname from the roster, but roster is being cleaned already, thus leading to use-after-free. Fix #1894 https://github.com/profanity-im/profanity/issues/1894
This commit is contained in:
parent
be42ffcee9
commit
3838e5a982
@ -312,7 +312,10 @@ win_get_title(ProfWin* window)
|
||||
{
|
||||
const ProfChatWin* chatwin = (ProfChatWin*)window;
|
||||
assert(chatwin->memcheck == PROFCHATWIN_MEMCHECK);
|
||||
const PContact contact = roster_get_contact(chatwin->barejid);
|
||||
PContact contact = NULL;
|
||||
if (roster_exists()) {
|
||||
contact = roster_get_contact(chatwin->barejid);
|
||||
}
|
||||
if (!contact) {
|
||||
return g_strdup(chatwin->barejid);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user