about summary refs log tree commit diff stats
path: root/src/xmpp
diff options
context:
space:
mode:
authorMichael Vetter <jubalh@iodoru.org>2021-03-25 17:02:59 +0100
committerMichael Vetter <jubalh@iodoru.org>2021-03-25 17:02:59 +0100
commita1a37cf9bfab2c3e2332a53e3e4e4f223649ca59 (patch)
treed84c25b607096938aa2df7401497647b15147bb5 /src/xmpp
parent8df5e9998166497104eedd664078c277a94bc8e2 (diff)
downloadprofani-tty-a1a37cf9bfab2c3e2332a53e3e4e4f223649ca59.tar.gz
ox: fix memleak in ox_announce_public_key
Diffstat (limited to 'src/xmpp')
-rw-r--r--src/xmpp/ox.c4
1 files changed, 3 insertions, 1 deletions
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);