Changeset 098a75b for otr.c


Ignore:
Timestamp:
2015-03-22T13:35:08Z (9 years ago)
Author:
dequis <dx@…>
Branches:
master
Children:
b95d03b
Parents:
2dd23da
git-author:
dequis <dx@…> (21-03-15 08:26:20)
git-committer:
dequis <dx@…> (22-03-15 13:35:08)
Message:

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
File:
1 edited

Legend:

Unmodified
Added
Removed
  • otr.c

    r2dd23da r098a75b  
    287287void otr_irc_free(irc_t *irc)
    288288{
     289        set_t *s;
    289290        otr_t *otr = irc->otr;
    290291
     
    292293        b_event_remove(otr->timer);
    293294        otrl_userstate_free(otr->us);
     295
     296        s = set_find(&irc->b->set, "otr_policy");
     297        g_slist_free(s->eval_data);
     298
    294299        if (otr->keygen) {
    295300                kill(otr->keygen, SIGTERM);
     
    434439                                            ic->acc->user, ic->acc->prpl->name, iu->bu->handle, msg, &newmsg,
    435440                                            &tlvs, NULL, NULL, NULL);
     441
     442        if (tlvs) {
     443                otrl_tlv_free(tlvs);
     444        }
    436445
    437446        if (ignore_msg) {
     
    472481                /* libotr wants us to replace our message */
    473482                /* NB: caller will free old msg */
    474                 msg = g_strdup(otrmsg);
     483                msg = st ? NULL : g_strdup(otrmsg);
    475484                otrl_message_free(otrmsg);
    476485        }
     
    13251334
    13261335        log_message(LOGLVL_INFO, "otr: %s", msg);
     1336
     1337        g_free(msg);
    13271338}
    13281339
     
    20752086        }
    20762087}
    2077 
    2078 /* vim: set noet ts=4 sw=4: */
Note: See TracChangeset for help on using the changeset viewer.