From dc5ddb8ebe5792a220803c4e0ba9a071177d4537 Mon Sep 17 00:00:00 2001 From: Dmitry Podgorny Date: Sun, 5 Apr 2020 15:57:27 +0300 Subject: Fix memory leak in _rosterwin_resources() --- src/ui/rosterwin.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src') diff --git a/src/ui/rosterwin.c b/src/ui/rosterwin.c index 1b4442f2..1d295053 100644 --- a/src/ui/rosterwin.c +++ b/src/ui/rosterwin.c @@ -562,6 +562,7 @@ _rosterwin_resources(ProfLayoutSplit *layout, PContact contact, int current_inde wattron(layout->subwin, theme_attrs(presence_colour)); win_sub_print(layout->subwin, unreadmsg->str, FALSE, wrap, current_indent); + g_string_free(unreadmsg, TRUE); wattroff(layout->subwin, theme_attrs(presence_colour)); } prefs_free_string(unreadpos); -- cgit 1.4.1-2-gfad0 From ded48a7e40644050a99d36375b569f581b60bb7f Mon Sep 17 00:00:00 2001 From: Dmitry Podgorny Date: Sun, 5 Apr 2020 15:58:28 +0300 Subject: Fix memory leak in stanza_attach_correction() xmpp_stanza_add_child() takes own reference to the child stanza. Therefore we have to release our reference or the child is lost and not freed otherwise. --- src/xmpp/stanza.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src') diff --git a/src/xmpp/stanza.c b/src/xmpp/stanza.c index 06620c53..8791100b 100644 --- a/src/xmpp/stanza.c +++ b/src/xmpp/stanza.c @@ -2627,6 +2627,7 @@ stanza_attach_correction(xmpp_ctx_t *ctx, xmpp_stanza_t *stanza, const char *con xmpp_stanza_set_id(replace_stanza, replace_id); xmpp_stanza_set_ns(replace_stanza, STANZA_NS_LAST_MESSAGE_CORRECTION); xmpp_stanza_add_child(stanza, replace_stanza); + xmpp_stanza_release(replace_stanza); return stanza; } -- cgit 1.4.1-2-gfad0