Changeset 1145964 for protocols


Ignore:
Timestamp:
2008-06-29T11:11:50Z (16 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
cd63d58
Parents:
565a1ea
Message:

Fixed two memory leaks in the MSN module.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • protocols/msn/ns.c

    r565a1ea r1145964  
    278278                if( num_parts == 5 )
    279279                {
     280                        int i, groupcount;
     281                       
     282                        groupcount = atoi( cmd[4] );
     283                        if( groupcount > 0 )
     284                        {
     285                                /* valgrind says this is leaking memory, I'm guessing
     286                                   that this happens during server redirects. */
     287                                if( md->grouplist )
     288                                {
     289                                        for( i = 0; i < md->groupcount; i ++ )
     290                                                g_free( md->grouplist[i] );
     291                                        g_free( md->grouplist );
     292                                }
     293                               
     294                                md->groupcount = groupcount;
     295                                md->grouplist = g_new0( char *, md->groupcount );
     296                        }
     297                       
    280298                        md->buddycount = atoi( cmd[3] );
    281                         md->groupcount = atoi( cmd[4] );
    282                         if( md->groupcount > 0 )
    283                                 md->grouplist = g_new0( char *, md->groupcount );
    284                        
    285299                        if( !*cmd[3] || md->buddycount == 0 )
    286300                                msn_logged_in( ic );
     
    665679                                        imcb_log( ic, "INBOX contains %s new messages, plus %s messages in other folders.", inbox, folders );
    666680                                }
     681                               
     682                                g_free( inbox );
     683                                g_free( folders );
    667684                        }
    668685                        else if( g_strncasecmp( ct, "text/x-msmsgsemailnotification", 30 ) == 0 )
Note: See TracChangeset for help on using the changeset viewer.