diff options
author | dequis <dx@dxzone.com.ar> | 2015-03-21 05:26:20 -0300 |
---|---|---|
committer | dequis <dx@dxzone.com.ar> | 2015-03-22 10:35:08 -0300 |
commit | 098a75b2b2f6a23b5740f6a2032d8a4c8d0d36b2 (patch) | |
tree | ef90f8b10c0b41fd1a90f2f13c1d8f6bf62fa872 /irc_im.c | |
parent | 2dd23da38926e777c1dba707350b2afcf9421b25 (diff) |
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
Diffstat (limited to 'irc_im.c')
-rw-r--r-- | irc_im.c | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -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; } |