Changeset 99c8f13


Ignore:
Timestamp:
2009-10-17T14:48:21Z (15 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
57d8421
Parents:
e71cfbc
Message:

Valgrind pointed me at some memory leaks in the Yahoo! codek, including one
that existed for a while already. Fixed.

Location:
protocols/yahoo
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • protocols/yahoo/libyahoo2.c

    re71cfbc r99c8f13  
    24862486        yahoo_packet_free(pack);
    24872487       
    2488         return;
    2489        
    24902488fail:
     2489        g_free(crumb);
    24912490        g_free(had->token);
    24922491        g_free(had->chal);
     
    41354134        LOG(("yahoo_logoff: current status: %d", yd->current_status));
    41364135
    4137         if(yd->current_status != -1) {
     4136        if(yd->current_status != -1 && 0) {
     4137                /* Meh. Don't send this. The event handlers are not going to
     4138                   get to do this so it'll just leak memory. And the TCP
     4139                   connection reset will hopefully be clear enough. */
    41384140                pkt = yahoo_packet_new(YAHOO_SERVICE_LOGOFF, YAHOO_STATUS_AVAILABLE, yd->session_id);
    41394141                yd->current_status = -1;
  • protocols/yahoo/yahoo.c

    re71cfbc r99c8f13  
    254254static GList *byahoo_away_states( struct im_connection *ic )
    255255{
    256         GList *m = NULL;
    257 
    258         m = g_list_append( m, "Available" );
    259         m = g_list_append( m, "Be Right Back" );
    260         m = g_list_append( m, "Busy" );
    261         m = g_list_append( m, "Not At Home" );
    262         m = g_list_append( m, "Not At Desk" );
    263         m = g_list_append( m, "Not In Office" );
    264         m = g_list_append( m, "On Phone" );
    265         m = g_list_append( m, "On Vacation" );
    266         m = g_list_append( m, "Out To Lunch" );
    267         m = g_list_append( m, "Stepped Out" );
    268         m = g_list_append( m, "Invisible" );
    269         m = g_list_append( m, GAIM_AWAY_CUSTOM );
     256        static GList *m = NULL;
     257
     258        if( m == NULL )
     259        {
     260                m = g_list_append( m, "Available" );
     261                m = g_list_append( m, "Be Right Back" );
     262                m = g_list_append( m, "Busy" );
     263                m = g_list_append( m, "Not At Home" );
     264                m = g_list_append( m, "Not At Desk" );
     265                m = g_list_append( m, "Not In Office" );
     266                m = g_list_append( m, "On Phone" );
     267                m = g_list_append( m, "On Vacation" );
     268                m = g_list_append( m, "Out To Lunch" );
     269                m = g_list_append( m, "Stepped Out" );
     270                m = g_list_append( m, "Invisible" );
     271                m = g_list_append( m, GAIM_AWAY_CUSTOM );
     272        }
    270273       
    271274        return m;
Note: See TracChangeset for help on using the changeset viewer.