comparison src/protocols/oscar/locate.c @ 8393:8deb49dea682

[gaim-migrate @ 9122] Fix a GINORMOUS memleak of ZERO bytes. You heard me. I installed Gentoo for THIS? I'm off to get my 5 hours of sleep. committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Wed, 03 Mar 2004 07:23:30 +0000
parents 59e83fdb753e
children a41efeb3a9ee
comparison
equal deleted inserted replaced
8392:6995abd533f5 8393:8deb49dea682
239 } 239 }
240 240
241 if (userinfo->info != NULL) { 241 if (userinfo->info != NULL) {
242 free(cur->info); 242 free(cur->info);
243 free(cur->info_encoding); 243 free(cur->info_encoding);
244 cur->info = (char *)malloc(userinfo->info_len); 244 if (userinfo->info_len > 0) {
245 memcpy(cur->info, userinfo->info, userinfo->info_len); 245 cur->info = (char *)malloc(userinfo->info_len);
246 memcpy(cur->info, userinfo->info, userinfo->info_len);
247 }
246 cur->info_encoding = strdup(userinfo->info_encoding); 248 cur->info_encoding = strdup(userinfo->info_encoding);
247 cur->info_len = userinfo->info_len; 249 cur->info_len = userinfo->info_len;
248 } 250 }
249 251
250 if (userinfo->away != NULL) { 252 if (userinfo->away != NULL) {
251 free(cur->away); 253 free(cur->away);
252 free(cur->away_encoding); 254 free(cur->away_encoding);
253 cur->away = (char *)malloc(userinfo->away_len); 255 if (userinfo->away_len > 0) {
254 memcpy(cur->away, userinfo->away, userinfo->away_len); 256 cur->away = (char *)malloc(userinfo->away_len);
257 memcpy(cur->away, userinfo->away, userinfo->away_len);
258 }
255 cur->away_encoding = strdup(userinfo->away_encoding); 259 cur->away_encoding = strdup(userinfo->away_encoding);
256 cur->away_len = userinfo->away_len; 260 cur->away_len = userinfo->away_len;
257 } 261 }
258 } 262 }
259 263