about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorJames Booth <boothj5@gmail.com>2014-06-15 20:56:24 +0100
committerJames Booth <boothj5@gmail.com>2014-06-15 20:56:24 +0100
commitd181f500ea2548bf6f69a0fb396293c5a4fa6d3b (patch)
tree4452a68a6fad8650f14c8359887b5bf9c937473e
parentccf5cb846ba13d6b9356a0ce01576e9f95103a23 (diff)
downloadprofani-tty-d181f500ea2548bf6f69a0fb396293c5a4fa6d3b.tar.gz
Fixed usages of get_unique_id to free result
-rw-r--r--src/xmpp/bookmark.c3
-rw-r--r--src/xmpp/presence.c3
-rw-r--r--src/xmpp/stanza.c7
3 files changed, 12 insertions, 1 deletions
diff --git a/src/xmpp/bookmark.c b/src/xmpp/bookmark.c
index 01e86451..1a7196a1 100644
--- a/src/xmpp/bookmark.c
+++ b/src/xmpp/bookmark.c
@@ -403,6 +403,7 @@ _send_bookmarks(void)
     xmpp_stanza_set_name(iq, STANZA_NAME_IQ);
     char *id = generate_unique_id("bookmarks_update");
     xmpp_stanza_set_id(iq, id);
+    free(id);
     xmpp_stanza_set_type(iq, STANZA_TYPE_SET);
 
     xmpp_stanza_t *query = xmpp_stanza_new(ctx);
@@ -479,4 +480,4 @@ bookmark_init_module(void)
     bookmark_get_list = _bookmark_get_list;
     bookmark_find = _bookmark_find;
     bookmark_autocomplete_reset = _bookmark_autocomplete_reset;
-}
\ No newline at end of file
+}
diff --git a/src/xmpp/presence.c b/src/xmpp/presence.c
index d6a2c7f2..a1cb0ab9 100644
--- a/src/xmpp/presence.c
+++ b/src/xmpp/presence.c
@@ -125,6 +125,7 @@ _presence_subscription(const char * const jid, const jabber_subscr_t action)
     xmpp_stanza_release(presence);
 
     jid_destroy(jidp);
+    free(id);
 }
 
 static GSList *
@@ -224,6 +225,7 @@ _presence_update(const resource_presence_t presence_type, const char * const msg
         last = STANZA_TEXT_ONLINE;
     }
     accounts_set_last_presence(jabber_get_account_name(), last);
+    free(id);
 }
 
 static void
@@ -626,6 +628,7 @@ _get_caps_key(xmpp_stanza_t * const stanza)
         id = generate_unique_id("caps");
 
         _send_caps_request(node, caps_key, id, from);
+        free(id);
 
     // unsupported hash or legacy capabilities
     } else {
diff --git a/src/xmpp/stanza.c b/src/xmpp/stanza.c
index 6006fdb4..3f0b5015 100644
--- a/src/xmpp/stanza.c
+++ b/src/xmpp/stanza.c
@@ -198,6 +198,7 @@ stanza_create_chat_state(xmpp_ctx_t *ctx, const char * const recipient,
     xmpp_stanza_set_attribute(msg, STANZA_ATTR_TO, recipient);
     char *id = generate_unique_id(NULL);
     xmpp_stanza_set_id(msg, id);
+    free(id);
 
     chat_state = xmpp_stanza_new(ctx);
     xmpp_stanza_set_name(chat_state, state);
@@ -221,6 +222,7 @@ stanza_create_message(xmpp_ctx_t *ctx, const char * const recipient,
     xmpp_stanza_set_attribute(msg, STANZA_ATTR_TO, recipient);
     char *id = generate_unique_id(NULL);
     xmpp_stanza_set_id(msg, id);
+    free(id);
 
     body = xmpp_stanza_new(ctx);
     xmpp_stanza_set_name(body, STANZA_NAME_BODY);
@@ -324,6 +326,7 @@ stanza_create_invite(xmpp_ctx_t *ctx, const char * const room,
     xmpp_stanza_set_attribute(message, STANZA_ATTR_TO, contact);
     char *id = generate_unique_id(NULL);
     xmpp_stanza_set_id(message, id);
+    free(id);
 
     x = xmpp_stanza_new(ctx);
     xmpp_stanza_set_name(x, STANZA_NAME_X);
@@ -349,6 +352,7 @@ stanza_create_room_join_presence(xmpp_ctx_t * const ctx,
     xmpp_stanza_set_attribute(presence, STANZA_ATTR_TO, full_room_jid);
     char *id = generate_unique_id("join");
     xmpp_stanza_set_id(presence, id);
+    free(id);
 
     xmpp_stanza_t *x = xmpp_stanza_new(ctx);
     xmpp_stanza_set_name(x, STANZA_NAME_X);
@@ -379,6 +383,7 @@ stanza_create_room_newnick_presence(xmpp_ctx_t *ctx,
     xmpp_stanza_t *presence = xmpp_stanza_new(ctx);
     char *id = generate_unique_id("sub");
     xmpp_stanza_set_id(presence, id);
+    free(id);
     xmpp_stanza_set_name(presence, STANZA_NAME_PRESENCE);
     xmpp_stanza_set_attribute(presence, STANZA_ATTR_TO, full_room_jid);
 
@@ -399,6 +404,7 @@ stanza_create_room_leave_presence(xmpp_ctx_t *ctx, const char * const room,
     xmpp_stanza_set_attribute(presence, STANZA_ATTR_TO, full_jid->str);
     char *id = generate_unique_id("leave");
     xmpp_stanza_set_id(presence, id);
+    free(id);
 
     g_string_free(full_jid, TRUE);
 
@@ -512,6 +518,7 @@ stanza_create_ping_iq(xmpp_ctx_t *ctx)
     xmpp_stanza_set_type(iq, STANZA_TYPE_GET);
     char *id = generate_unique_id("ping");
     xmpp_stanza_set_id(iq, id);
+    free(id);
 
     xmpp_stanza_t *ping = xmpp_stanza_new(ctx);
     xmpp_stanza_set_name(ping, STANZA_NAME_PING);