Mercurial > pidgin.yaz
changeset 7046:4003419d753b
[gaim-migrate @ 7609]
I found my memleak and I made server-stored buddy icons from other people
work again (both problems started with my away changes from this morning).
committer: Tailor Script <tailor@pidgin.im>
author | Mark Doliner <mark@kingant.net> |
---|---|
date | Tue, 30 Sep 2003 01:50:39 +0000 |
parents | 237ad253dd34 |
children | 7d1909655fd0 |
files | src/protocols/oscar/locate.c |
diffstat | 1 files changed, 15 insertions(+), 11 deletions(-) [+] |
line wrap: on
line diff
--- a/src/protocols/oscar/locate.c Tue Sep 30 01:32:29 2003 +0000 +++ b/src/protocols/oscar/locate.c Tue Sep 30 01:50:39 2003 +0000 @@ -209,13 +209,11 @@ cur->capabilities = userinfo->capabilities; cur->present |= userinfo->present; - if ((userinfo->away != NULL) && (userinfo->away_len > 0)) { - free(cur->away); - free(cur->away_encoding); - cur->away = (char *)malloc(userinfo->away_len); - memcpy(cur->away, userinfo->away, userinfo->away_len); - cur->away_encoding = strdup(userinfo->away_encoding); /* XXX - This seems to leak occasionally */ - cur->away_len = userinfo->away_len; + if (userinfo->iconcsumlen > 0) { + free(cur->iconcsum); + cur->iconcsum = (fu8_t *)malloc(userinfo->iconcsumlen); + memcpy(cur->iconcsum, userinfo->iconcsum, userinfo->iconcsumlen); + cur->iconcsumlen = userinfo->iconcsumlen; } if ((userinfo->info != NULL) && (userinfo->info_len > 0)) { @@ -226,6 +224,15 @@ cur->info_encoding = strdup(userinfo->info_encoding); /* XXX - This seems to leak occasionally */ cur->info_len = userinfo->info_len; } + + if ((userinfo->away != NULL) && (userinfo->away_len > 0)) { + free(cur->away); + free(cur->away_encoding); + cur->away = (char *)malloc(userinfo->away_len); + memcpy(cur->away, userinfo->away, userinfo->away_len); + cur->away_encoding = strdup(userinfo->away_encoding); /* XXX - This seems to leak occasionally */ + cur->away_len = userinfo->away_len; + } } static void aim_locate_dorequest(aim_session_t *sess) { @@ -1133,10 +1140,7 @@ while (sess->locate.userinfo) { del = sess->locate.userinfo; sess->locate.userinfo = sess->locate.userinfo->next; - free(del->sn); - free(del->info); - free(del->avail); - free(del->away); + aim_info_free(del); free(del); } }