aboutsummaryrefslogtreecommitdiffstats
path: root/protocols/msn/ns.c
diff options
context:
space:
mode:
authorulim <a.sporto+bee@gmail.com>2008-08-04 16:45:24 +0200
committerulim <a.sporto+bee@gmail.com>2008-08-04 16:45:24 +0200
commit8661caad555f4306cf36ee37979a7637b05d5cd4 (patch)
tree7e4a7c3d6a700610dd31d109508b07caa3253902 /protocols/msn/ns.c
parent4ac647dbcef152bebde7209f7c9cbbf8a5e0fc37 (diff)
parent718e05f842c1af043eb4efded8b0afe429377f70 (diff)
merged in upstream r410.
Only conflict was the correction of jabber normalization which I had already done.
Diffstat (limited to 'protocols/msn/ns.c')
-rw-r--r--protocols/msn/ns.c23
1 files changed, 20 insertions, 3 deletions
diff --git a/protocols/msn/ns.c b/protocols/msn/ns.c
index ffaa90a7..fe48f96d 100644
--- a/protocols/msn/ns.c
+++ b/protocols/msn/ns.c
@@ -277,11 +277,25 @@ static int msn_ns_command( gpointer data, char **cmd, int num_parts )
{
if( num_parts == 5 )
{
- md->buddycount = atoi( cmd[3] );
- md->groupcount = atoi( cmd[4] );
- if( md->groupcount > 0 )
+ int i, groupcount;
+
+ groupcount = atoi( cmd[4] );
+ if( groupcount > 0 )
+ {
+ /* valgrind says this is leaking memory, I'm guessing
+ that this happens during server redirects. */
+ if( md->grouplist )
+ {
+ for( i = 0; i < md->groupcount; i ++ )
+ g_free( md->grouplist[i] );
+ g_free( md->grouplist );
+ }
+
+ md->groupcount = groupcount;
md->grouplist = g_new0( char *, md->groupcount );
+ }
+ md->buddycount = atoi( cmd[3] );
if( !*cmd[3] || md->buddycount == 0 )
msn_logged_in( ic );
}
@@ -664,6 +678,9 @@ static int msn_ns_message( gpointer data, char *msg, int msglen, char **cmd, int
{
imcb_log( ic, "INBOX contains %s new messages, plus %s messages in other folders.", inbox, folders );
}
+
+ g_free( inbox );
+ g_free( folders );
}
else if( g_strncasecmp( ct, "text/x-msmsgsemailnotification", 30 ) == 0 )
{