From 098a75b2b2f6a23b5740f6a2032d8a4c8d0d36b2 Mon Sep 17 00:00:00 2001 From: dequis Date: Sat, 21 Mar 2015 05:26:20 -0300 Subject: Fix a bunch of memory leaks - irc_im.c: - bee_irc_user_msg: strdup leaks when otr swallows messages - bee_irc_user_action_response: GString leak in all ctcp replies - otr.c: - call g_slist_free() on the list of the otr_policy setting - otr_filter_msg_in: call otrl_tlv_free() if "tlvs" are returned - otr_filter_msg_out: don't g_strdup() if the message should be ignored - log_otr_message: g_strdup_vprintf() leaks always - nogaim.c: - imcb_ask_auth/imcb_ask_add: leaks in g_strdup_printf() - imcb_ask_add leaks imcb_ask_cb_data if the user already exists - add imcb_ask_cb_free() to correctly free its data - msn_util.c: add msn_buddy_ask_free(), ditto - storage_xml.c: pass_cr/password if base64_decode or arc_decode fail - ssl_gnutls.c: conn->hostname leak in error conditions, like invalid certs - jabber_util.c: jabber_buddy_by_ext_jid() leaks jid if it's not an ext jid --- irc_im.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'irc_im.c') diff --git a/irc_im.c b/irc_im.c index 0b02ff89..d71c9ee9 100644 --- a/irc_im.c +++ b/irc_im.c @@ -234,7 +234,7 @@ static gboolean bee_irc_user_msg(bee_t *bee, bee_user_t *bu, const char *msg_, t msg = s; } else { /* Modules can swallow messages. */ - return TRUE; + goto cleanup; } } } @@ -249,8 +249,9 @@ static gboolean bee_irc_user_msg(bee_t *bee, bee_user_t *bu, const char *msg_, t wrapped = word_wrap(msg, 425); irc_send_msg(iu, "PRIVMSG", dst, wrapped, prefix); - g_free(wrapped); + +cleanup: g_free(prefix); g_free(msg); g_free(ts); @@ -291,6 +292,8 @@ static gboolean bee_irc_user_action_response(bee_t *bee, bee_user_t *bu, const c irc_send_msg((irc_user_t *) bu->ui_data, "NOTICE", irc->user->nick, msg->str, NULL); + g_string_free(msg, TRUE); + return TRUE; } -- cgit v1.2.3