Fix various memleaks in mam.c

This commit is contained in:
Michael Vetter 2020-12-21 17:01:01 +01:00
parent b7723db1fc
commit 93e5a669c6

View File

@ -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);
}