From 93e5a669c6d49ec80eff095ba93171c4198a36bd Mon Sep 17 00:00:00 2001 From: Michael Vetter Date: Mon, 21 Dec 2020 17:01:01 +0100 Subject: [PATCH] Fix various memleaks in mam.c --- src/mode/mam.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/mode/mam.c b/src/mode/mam.c index 553c420..ea5db27 100644 --- a/src/mode/mam.c +++ b/src/mode/mam.c @@ -102,6 +102,10 @@ static void _mam_request(xmppc_t *xmppc, char* to, bool pretty) { xmpp_stanza_add_child(f,v); xmpp_stanza_add_child(v,b); + xmpp_stanza_release(f); + xmpp_stanza_release(v); + xmpp_stanza_release(b); + f = xmpp_stanza_new(xmppc->ctx); xmpp_stanza_set_name(f,"field"); xmpp_stanza_set_attribute(f, "var", "with"); @@ -119,6 +123,13 @@ static void _mam_request(xmppc_t *xmppc, char* to, bool pretty) { xmpp_id_handler_add(xmppc->conn, _mam_show, id, xmppc); xmpp_send(xmppc->conn,iq); + xmpp_stanza_release(iq); + xmpp_stanza_release(x); + xmpp_stanza_release(f); + xmpp_stanza_release(v); + xmpp_stanza_release(b); + xmpp_stanza_release(query); + free(id); }