1
0
mirror of https://github.com/profanity-im/profanity.git synced 2024-09-22 19:45:54 -04:00

Fix memleak in _handle_groupchat()

We need to unref the timestamp before setting a new one.
This commit is contained in:
Michael Vetter 2020-02-25 15:24:53 +01:00
parent 240aeac4d3
commit e9c5c1979d

View File

@ -872,7 +872,12 @@ _handle_groupchat(xmpp_stanza_t *const stanza)
message->timestamp = stanza_get_delay_from(stanza, jid->domainpart);
}
bool is_muc_history = message->timestamp != NULL;
bool is_muc_history;
if (message->timestamp != NULL) {
is_muc_history = TRUE;
g_date_time_unref(message->timestamp);
message->timestamp = NULL;
}
// we want to display the oldest delay
message->timestamp = stanza_get_oldest_delay(stanza);