about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorMichael Vetter <jubalh@iodoru.org>2020-03-29 21:57:57 +0200
committerGitHub <noreply@github.com>2020-03-29 21:57:57 +0200
commit89502ca199de777039423e7f636bc944e558946e (patch)
tree809441239d5d4ee77f502c4b1d44dfef3dd7a438
parentc520c3d3c39e079bb6370f5490fa8d24c865feca (diff)
parent6c649a9de80589d51bc267874997c1cf1df0f48b (diff)
downloadprofani-tty-89502ca199de777039423e7f636bc944e558946e.tar.gz
Merge pull request #1292 from profanity-im/memleak-issue1279
Fix memory leak of presence object
-rw-r--r--src/xmpp/roster_list.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/xmpp/roster_list.c b/src/xmpp/roster_list.c
index 3dadb884..49f067d6 100644
--- a/src/xmpp/roster_list.c
+++ b/src/xmpp/roster_list.c
@@ -140,6 +140,8 @@ roster_update_presence(const char *const barejid, Resource *resource, GDateTime
 
     PContact contact = roster_get_contact(barejid);
     if (contact == NULL) {
+        /* Don't lose resource when there is no owner. */
+        resource_destroy(resource);
         return FALSE;
     }
     if (!_datetimes_equal(p_contact_last_activity(contact), last_activity)) {