diff options
author | Michael Vetter <jubalh@iodoru.org> | 2020-02-25 15:24:53 +0100 |
---|---|---|
committer | Michael Vetter <jubalh@iodoru.org> | 2020-02-25 15:26:33 +0100 |
commit | e9c5c1979d836ed75c37d48651710b4fd125cfb2 (patch) | |
tree | a7d6c9ec77c5c66b3cf72cbada307c6fb5921bae | |
parent | 240aeac4d369df97d0e4ee54bd2924afe75258c8 (diff) | |
download | profani-tty-e9c5c1979d836ed75c37d48651710b4fd125cfb2.tar.gz |
Fix memleak in _handle_groupchat()
We need to unref the timestamp before setting a new one.
-rw-r--r-- | src/xmpp/message.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/xmpp/message.c b/src/xmpp/message.c index a5c6c33f..41ab6a81 100644 --- a/src/xmpp/message.c +++ b/src/xmpp/message.c @@ -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); |