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

Merge pull request #1292 from profanity-im/memleak-issue1279

Fix memory leak of presence object
This commit is contained in:
Michael Vetter 2020-03-29 21:57:57 +02:00 committed by GitHub
commit 89502ca199
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -140,6 +140,8 @@ roster_update_presence(const char *const barejid, Resource *resource, GDateTime
PContact contact = roster_get_contact(barejid); PContact contact = roster_get_contact(barejid);
if (contact == NULL) { if (contact == NULL) {
/* Don't lose resource when there is no owner. */
resource_destroy(resource);
return FALSE; return FALSE;
} }
if (!_datetimes_equal(p_contact_last_activity(contact), last_activity)) { if (!_datetimes_equal(p_contact_last_activity(contact), last_activity)) {