1
0
mirror of https://github.com/profanity-im/profanity.git synced 2024-11-03 19:37:16 -05:00

Fixed usages of get_unique_id to free result

This commit is contained in:
James Booth 2014-06-15 20:56:24 +01:00
parent ccf5cb846b
commit d181f500ea
3 changed files with 12 additions and 1 deletions

View File

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

View File

@ -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 {

View File

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