Changes in / [3dcc878:61d21e5b]


Ignore:
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • irc_im.c

    r3dcc878 r61d21e5b  
    235235                        } else {
    236236                                /* Modules can swallow messages. */
    237                                 goto cleanup;
     237                                return TRUE;
    238238                        }
    239239                }
     
    250250        wrapped = word_wrap(msg, 425);
    251251        irc_send_msg(iu, "PRIVMSG", dst, wrapped, prefix);
     252
    252253        g_free(wrapped);
    253 
    254 cleanup:
    255254        g_free(prefix);
    256255        g_free(msg);
     
    292291
    293292        irc_send_msg((irc_user_t *) bu->ui_data, "NOTICE", irc->user->nick, msg->str, NULL);
    294 
    295         g_string_free(msg, TRUE);
    296293
    297294        return TRUE;
     
    698695        irc_t *irc = bee->ui_data;
    699696        irc_channel_t *ic = c->ui_data, *oic;
    700         char *stripped, *full_name;
    701         gsize bytes_written;
     697        char stripped[MAX_NICK_LENGTH + 1], *full_name;
    702698
    703699        if (ic == NULL) {
     
    710706        }
    711707
    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 
     708        strncpy(stripped, name, MAX_NICK_LENGTH);
     709        stripped[MAX_NICK_LENGTH] = '\0';
    717710        irc_channel_name_strip(stripped);
    718711        if (set_getbool(&bee->set, "lcnicks")) {
     
    721714
    722715        if (stripped[0] == '\0') {
    723                 g_free(stripped);
    724716                return FALSE;
    725717        }
    726718
    727719        full_name = g_strdup_printf("#%s", stripped);
    728         g_free(stripped);
    729720        if ((oic = irc_channel_by_name(irc, full_name))) {
    730721                char *type, *chat_type;
  • lib/ssl_gnutls.c

    r3dcc878 r61d21e5b  
    124124
    125125        if (conn->fd < 0) {
    126                 g_free(conn->hostname);
    127126                g_free(conn);
    128127                return NULL;
     
    315314        if (source == -1) {
    316315                conn->func(conn->data, 0, NULL, cond);
    317                 g_free(conn->hostname);
    318316                g_free(conn);
    319317                return FALSE;
     
    357355                        conn->func(conn->data, 0, NULL, cond);
    358356
    359                         ssl_disconnect(conn);
     357                        gnutls_deinit(conn->session);
     358                        closesocket(conn->fd);
     359
     360                        g_free(conn);
    360361                }
    361362        } else {
     
    363364                        conn->func(conn->data, stver, NULL, cond);
    364365
    365                         ssl_disconnect(conn);
     366                        gnutls_deinit(conn->session);
     367                        closesocket(conn->fd);
     368
     369                        g_free(conn);
    366370                } else {
    367371                        /* For now we can't handle non-blocking perfectly everywhere... */
  • otr.c

    r3dcc878 r61d21e5b  
    287287void otr_irc_free(irc_t *irc)
    288288{
    289         set_t *s;
    290289        otr_t *otr = irc->otr;
    291290
     
    293292        b_event_remove(otr->timer);
    294293        otrl_userstate_free(otr->us);
    295 
    296         s = set_find(&irc->b->set, "otr_policy");
    297         g_slist_free(s->eval_data);
    298 
    299294        if (otr->keygen) {
    300295                kill(otr->keygen, SIGTERM);
     
    439434                                            ic->acc->user, ic->acc->prpl->name, iu->bu->handle, msg, &newmsg,
    440435                                            &tlvs, NULL, NULL, NULL);
    441 
    442         if (tlvs) {
    443                 otrl_tlv_free(tlvs);
    444         }
    445436
    446437        if (ignore_msg) {
     
    481472                /* libotr wants us to replace our message */
    482473                /* NB: caller will free old msg */
    483                 msg = st ? NULL : g_strdup(otrmsg);
     474                msg = g_strdup(otrmsg);
    484475                otrl_message_free(otrmsg);
    485476        }
     
    13341325
    13351326        log_message(LOGLVL_INFO, "otr: %s", msg);
    1336 
    1337         g_free(msg);
    13381327}
    13391328
     
    20862075        }
    20872076}
     2077
     2078/* vim: set noet ts=4 sw=4: */
  • protocols/jabber/jabber_util.c

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

    r3dcc878 r61d21e5b  
    174174};
    175175
    176 static void msn_buddy_ask_free(void *data)
     176static void msn_buddy_ask_yes(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);
    179183
    180184        g_free(bla->handle);
     
    183187}
    184188
    185 static void msn_buddy_ask_yes(void *data)
     189static void msn_buddy_ask_no(void *data)
    186190{
    187191        struct msn_buddy_ask_data *bla = data;
    188192
    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 
    196 static void msn_buddy_ask_no(void *data)
    197 {
    198         struct msn_buddy_ask_data *bla = data;
    199 
    200193        msn_buddy_list_add(bla->ic, MSN_BUDDY_BL, bla->handle, bla->realname, NULL);
    201194
    202         msn_buddy_ask_free(bla);
     195        g_free(bla->handle);
     196        g_free(bla->realname);
     197        g_free(bla);
    203198}
    204199
     
    221216                   "The user %s (%s) wants to add you to his/her buddy list.",
    222217                   bu->handle, bu->fullname);
    223 
    224         imcb_ask_with_free(bu->ic, buf, bla, msn_buddy_ask_yes, msn_buddy_ask_no, msn_buddy_ask_free);
     218        imcb_ask(bu->ic, buf, bla, msn_buddy_ask_yes, msn_buddy_ask_no);
    225219}
    226220
  • protocols/nogaim.c

    r3dcc878 r61d21e5b  
    498498};
    499499
    500 static void imcb_ask_cb_free(void *data)
     500static void imcb_ask_auth_cb_no(void *data)
    501501{
    502502        struct imcb_ask_cb_data *cbd = data;
     503
     504        cbd->ic->acc->prpl->auth_deny(cbd->ic, cbd->handle);
    503505
    504506        g_free(cbd->handle);
     
    506508}
    507509
    508 static void imcb_ask_auth_cb_no(void *data)
     510static void imcb_ask_auth_cb_yes(void *data)
    509511{
    510512        struct imcb_ask_cb_data *cbd = data;
    511513
    512         cbd->ic->acc->prpl->auth_deny(cbd->ic, cbd->handle);
    513 
    514         imcb_ask_cb_free(cbd);
    515 }
    516 
    517 static void imcb_ask_auth_cb_yes(void *data)
    518 {
    519         struct imcb_ask_cb_data *cbd = data;
    520 
    521514        cbd->ic->acc->prpl->auth_allow(cbd->ic, cbd->handle);
    522515
    523         imcb_ask_cb_free(cbd);
     516        g_free(cbd->handle);
     517        g_free(cbd);
    524518}
    525519
     
    541535        data->handle = g_strdup(handle);
    542536        query_add((irc_t *) ic->bee->ui_data, ic, s,
    543                   imcb_ask_auth_cb_yes, imcb_ask_auth_cb_no, imcb_ask_cb_free, data);
    544 
    545         g_free(s);
     537                  imcb_ask_auth_cb_yes, imcb_ask_auth_cb_no, g_free, data);
     538}
     539
     540
     541static void imcb_ask_add_cb_no(void *data)
     542{
     543        g_free(((struct imcb_ask_cb_data*) data)->handle);
     544        g_free(data);
    546545}
    547546
     
    552551        cbd->ic->acc->prpl->add_buddy(cbd->ic, cbd->handle, NULL);
    553552
    554         imcb_ask_cb_free(data);
     553        imcb_ask_add_cb_no(data);
    555554}
    556555
    557556void imcb_ask_add(struct im_connection *ic, const char *handle, const char *realname)
    558557{
    559         struct imcb_ask_cb_data *data;
     558        struct imcb_ask_cb_data *data = g_new0(struct imcb_ask_cb_data, 1);
    560559        char *s;
    561560
     
    565564        }
    566565
    567         data = g_new0(struct imcb_ask_cb_data, 1);
    568 
    569566        s = g_strdup_printf("The user %s is not in your buddy list yet. Do you want to add him/her now?", handle);
    570567
     
    572569        data->handle = g_strdup(handle);
    573570        query_add((irc_t *) ic->bee->ui_data, ic, s,
    574                   imcb_ask_add_cb_yes, imcb_ask_cb_free, imcb_ask_cb_free, data);
    575 
    576         g_free(s);
     571                  imcb_ask_add_cb_yes, imcb_ask_add_cb_no, g_free, data);
    577572}
    578573
  • storage_xml.c

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