Mercurial > pidgin
comparison src/prpl.c @ 11730:ef57eccb9a3b
[gaim-migrate @ 14021]
SF Patch #1335179 from sadrul
'The "status_types" prpl-functions return a list, which
is used to create another list in
gaim_prpl_get_statuses, but the original list is never
freed.'
This looks correct to me. It compiles. What more could you want? ;)
committer: Tailor Script <tailor@pidgin.im>
author | Richard Laager <rlaager@wiktel.com> |
---|---|
date | Sun, 23 Oct 2005 00:29:12 +0000 |
parents | 11e95968c9ff |
children | 0d9c6d2ad64b |
comparison
equal
deleted
inserted
replaced
11729:8a981a601242 | 11730:ef57eccb9a3b |
---|---|
330 gaim_prpl_get_statuses(GaimAccount *account, GaimPresence *presence) | 330 gaim_prpl_get_statuses(GaimAccount *account, GaimPresence *presence) |
331 { | 331 { |
332 GaimPlugin *prpl; | 332 GaimPlugin *prpl; |
333 GaimPluginProtocolInfo *prpl_info; | 333 GaimPluginProtocolInfo *prpl_info; |
334 GList *statuses = NULL; | 334 GList *statuses = NULL; |
335 GList *l; | 335 GList *l, *list; |
336 GaimStatus *status; | 336 GaimStatus *status; |
337 | 337 |
338 g_return_val_if_fail(account != NULL, NULL); | 338 g_return_val_if_fail(account != NULL, NULL); |
339 g_return_val_if_fail(presence != NULL, NULL); | 339 g_return_val_if_fail(presence != NULL, NULL); |
340 | 340 |
345 | 345 |
346 prpl_info = GAIM_PLUGIN_PROTOCOL_INFO(prpl); | 346 prpl_info = GAIM_PLUGIN_PROTOCOL_INFO(prpl); |
347 if (prpl_info == NULL || prpl_info->status_types == NULL) | 347 if (prpl_info == NULL || prpl_info->status_types == NULL) |
348 return NULL; | 348 return NULL; |
349 | 349 |
350 for (l = prpl_info->status_types(account); l != NULL; l = l->next) | 350 for (l = list = prpl_info->status_types(account); l != NULL; l = l->next) |
351 { | 351 { |
352 status = gaim_status_new((GaimStatusType *)l->data, presence); | 352 status = gaim_status_new((GaimStatusType *)l->data, presence); |
353 statuses = g_list_append(statuses, status); | 353 statuses = g_list_append(statuses, status); |
354 } | 354 } |
355 | |
356 g_list_free(list); | |
355 | 357 |
356 return statuses; | 358 return statuses; |
357 } | 359 } |
358 | 360 |
359 | 361 |