From a1a37cf9bfab2c3e2332a53e3e4e4f223649ca59 Mon Sep 17 00:00:00 2001 From: Michael Vetter Date: Thu, 25 Mar 2021 17:02:59 +0100 Subject: [PATCH] ox: fix memleak in ox_announce_public_key --- src/xmpp/ox.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/xmpp/ox.c b/src/xmpp/ox.c index 0f33322c..7a823bf0 100644 --- a/src/xmpp/ox.c +++ b/src/xmpp/ox.c @@ -118,7 +118,9 @@ ox_announce_public_key(const char* const filename) xmpp_stanza_t* item = xmpp_stanza_new(ctx); xmpp_stanza_set_name(item, STANZA_NAME_ITEM); - xmpp_stanza_set_attribute(item, STANZA_ATTR_ID, _gettimestamp()); + char *timestamp = _gettimestamp(); + xmpp_stanza_set_attribute(item, STANZA_ATTR_ID, timestamp); + free(timestamp); xmpp_stanza_t* pubkey = xmpp_stanza_new(ctx); xmpp_stanza_set_name(pubkey, STANZA_NAME_PUPKEY);