Changes in / [61d21e5b:3dcc878]


Ignore:
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • irc_im.c

    r61d21e5b r3dcc878  
    235235                        } else {
    236236                                /* Modules can swallow messages. */
    237                                 return TRUE;
     237                                goto cleanup;
    238238                        }
    239239                }
     
    250250        wrapped = word_wrap(msg, 425);
    251251        irc_send_msg(iu, "PRIVMSG", dst, wrapped, prefix);
    252 
    253252        g_free(wrapped);
     253
     254cleanup:
    254255        g_free(prefix);
    255256        g_free(msg);
     
    291292
    292293        irc_send_msg((irc_user_t *) bu->ui_data, "NOTICE", irc->user->nick, msg->str, NULL);
     294
     295        g_string_free(msg, TRUE);
    293296
    294297        return TRUE;
     
    695698        irc_t *irc = bee->ui_data;
    696699        irc_channel_t *ic = c->ui_data, *oic;
    697         char stripped[MAX_NICK_LENGTH + 1], *full_name;
     700        char *stripped, *full_name;
     701        gsize bytes_written;
    698702
    699703        if (ic == NULL) {
     
    706710        }
    707711
    708         strncpy(stripped, name, MAX_NICK_LENGTH);
    709         stripped[MAX_NICK_LENGTH] = '\0';
     712        stripped = g_convert_with_fallback(name, -1, "ASCII//TRANSLIT", "UTF-8", "", NULL, &bytes_written, NULL);
     713        if (bytes_written > MAX_NICK_LENGTH) {
     714                stripped[MAX_NICK_LENGTH] = '\0';
     715        }
     716
    710717        irc_channel_name_strip(stripped);
    711718        if (set_getbool(&bee->set, "lcnicks")) {
     
    714721
    715722        if (stripped[0] == '\0') {
     723                g_free(stripped);
    716724                return FALSE;
    717725        }
    718726
    719727        full_name = g_strdup_printf("#%s", stripped);
     728        g_free(stripped);
    720729        if ((oic = irc_channel_by_name(irc, full_name))) {
    721730                char *type, *chat_type;
  • lib/ssl_gnutls.c

    r61d21e5b r3dcc878  
    124124
    125125        if (conn->fd < 0) {
     126                g_free(conn->hostname);
    126127                g_free(conn);
    127128                return NULL;
     
    314315        if (source == -1) {
    315316                conn->func(conn->data, 0, NULL, cond);
     317                g_free(conn->hostname);
    316318                g_free(conn);
    317319                return FALSE;
     
    355357                        conn->func(conn->data, 0, NULL, cond);
    356358
    357                         gnutls_deinit(conn->session);
    358                         closesocket(conn->fd);
    359 
    360                         g_free(conn);
     359                        ssl_disconnect(conn);
    361360                }
    362361        } else {
     
    364363                        conn->func(conn->data, stver, NULL, cond);
    365364
    366                         gnutls_deinit(conn->session);
    367                         closesocket(conn->fd);
    368 
    369                         g_free(conn);
     365                        ssl_disconnect(conn);
    370366                } else {
    371367                        /* For now we can't handle non-blocking perfectly everywhere... */
  • otr.c

    r61d21e5b r3dcc878  
    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: */
  • protocols/jabber/jabber_util.c

    r61d21e5b r3dcc878  
    566566
    567567        if ((s = strchr(jid, '=')) == NULL) {
     568                g_free(jid);
    568569                return NULL;
    569570        }
  • protocols/msn/msn_util.c

    r61d21e5b r3dcc878  
    174174};
    175175
    176 static void msn_buddy_ask_yes(void *data)
     176static void msn_buddy_ask_free(void *data)
    177177{
    178178        struct msn_buddy_ask_data *bla = data;
    179 
    180         msn_buddy_list_add(bla->ic, MSN_BUDDY_AL, bla->handle, bla->realname, NULL);
    181 
    182         imcb_ask_add(bla->ic, bla->handle, NULL);
    183179
    184180        g_free(bla->handle);
     
    187183}
    188184
     185static void msn_buddy_ask_yes(void *data)
     186{
     187        struct msn_buddy_ask_data *bla = data;
     188
     189        msn_buddy_list_add(bla->ic, MSN_BUDDY_AL, bla->handle, bla->realname, NULL);
     190
     191        imcb_ask_add(bla->ic, bla->handle, NULL);
     192
     193        msn_buddy_ask_free(bla);
     194}
     195
    189196static void msn_buddy_ask_no(void *data)
    190197{
     
    193200        msn_buddy_list_add(bla->ic, MSN_BUDDY_BL, bla->handle, bla->realname, NULL);
    194201
    195         g_free(bla->handle);
    196         g_free(bla->realname);
    197         g_free(bla);
     202        msn_buddy_ask_free(bla);
    198203}
    199204
     
    216221                   "The user %s (%s) wants to add you to his/her buddy list.",
    217222                   bu->handle, bu->fullname);
    218         imcb_ask(bu->ic, buf, bla, msn_buddy_ask_yes, msn_buddy_ask_no);
     223
     224        imcb_ask_with_free(bu->ic, buf, bla, msn_buddy_ask_yes, msn_buddy_ask_no, msn_buddy_ask_free);
    219225}
    220226
  • protocols/nogaim.c

    r61d21e5b r3dcc878  
    498498};
    499499
    500 static void imcb_ask_auth_cb_no(void *data)
     500static void imcb_ask_cb_free(void *data)
    501501{
    502502        struct imcb_ask_cb_data *cbd = data;
    503 
    504         cbd->ic->acc->prpl->auth_deny(cbd->ic, cbd->handle);
    505503
    506504        g_free(cbd->handle);
     
    508506}
    509507
     508static void imcb_ask_auth_cb_no(void *data)
     509{
     510        struct imcb_ask_cb_data *cbd = data;
     511
     512        cbd->ic->acc->prpl->auth_deny(cbd->ic, cbd->handle);
     513
     514        imcb_ask_cb_free(cbd);
     515}
     516
    510517static void imcb_ask_auth_cb_yes(void *data)
    511518{
     
    514521        cbd->ic->acc->prpl->auth_allow(cbd->ic, cbd->handle);
    515522
    516         g_free(cbd->handle);
    517         g_free(cbd);
     523        imcb_ask_cb_free(cbd);
    518524}
    519525
     
    535541        data->handle = g_strdup(handle);
    536542        query_add((irc_t *) ic->bee->ui_data, ic, s,
    537                   imcb_ask_auth_cb_yes, imcb_ask_auth_cb_no, g_free, data);
    538 }
    539 
    540 
    541 static void imcb_ask_add_cb_no(void *data)
    542 {
    543         g_free(((struct imcb_ask_cb_data*) data)->handle);
    544         g_free(data);
     543                  imcb_ask_auth_cb_yes, imcb_ask_auth_cb_no, imcb_ask_cb_free, data);
     544
     545        g_free(s);
    545546}
    546547
     
    551552        cbd->ic->acc->prpl->add_buddy(cbd->ic, cbd->handle, NULL);
    552553
    553         imcb_ask_add_cb_no(data);
     554        imcb_ask_cb_free(data);
    554555}
    555556
    556557void imcb_ask_add(struct im_connection *ic, const char *handle, const char *realname)
    557558{
    558         struct imcb_ask_cb_data *data = g_new0(struct imcb_ask_cb_data, 1);
     559        struct imcb_ask_cb_data *data;
    559560        char *s;
    560561
     
    564565        }
    565566
     567        data = g_new0(struct imcb_ask_cb_data, 1);
     568
    566569        s = g_strdup_printf("The user %s is not in your buddy list yet. Do you want to add him/her now?", handle);
    567570
     
    569572        data->handle = g_strdup(handle);
    570573        query_add((irc_t *) ic->bee->ui_data, ic, s,
    571                   imcb_ask_add_cb_yes, imcb_ask_add_cb_no, g_free, data);
     574                  imcb_ask_add_cb_yes, imcb_ask_cb_free, imcb_ask_cb_free, data);
     575
     576        g_free(s);
    572577}
    573578
  • storage_xml.c

    r61d21e5b r3dcc878  
    128128                }
    129129        } else {
     130                g_free(pass_cr);
     131                g_free(password);
    130132                return XT_ABORT;
    131133        }
Note: See TracChangeset for help on using the changeset viewer.