Mercurial > pidgin
comparison src/pounce.c @ 13228:dd1996c9f3b6
[gaim-migrate @ 15593]
Cleanups by Sadrul to code like this:
if (foo != NULL) g_free(foo);
(From SF Patch #1429712)
committer: Tailor Script <tailor@pidgin.im>
author | Richard Laager <rlaager@wiktel.com> |
---|---|
date | Sat, 11 Feb 2006 18:16:58 +0000 |
parents | ebed1bbedb04 |
children | a9ff4499d9ce |
comparison
equal
deleted
inserted
replaced
13227:87d2d1230ba2 | 13228:dd1996c9f3b6 |
---|---|
285 PounceParserData *data = user_data; | 285 PounceParserData *data = user_data; |
286 | 286 |
287 if (data->buffer != NULL) | 287 if (data->buffer != NULL) |
288 g_string_free(data->buffer, TRUE); | 288 g_string_free(data->buffer, TRUE); |
289 | 289 |
290 if (data->ui_name != NULL) g_free(data->ui_name); | 290 g_free(data->ui_name); |
291 if (data->pouncee != NULL) g_free(data->pouncee); | 291 g_free(data->pouncee); |
292 if (data->protocol_id != NULL) g_free(data->protocol_id); | 292 g_free(data->protocol_id); |
293 if (data->event_type != NULL) g_free(data->event_type); | 293 g_free(data->event_type); |
294 if (data->option_type != NULL) g_free(data->option_type); | 294 g_free(data->option_type); |
295 if (data->action_name != NULL) g_free(data->action_name); | 295 g_free(data->action_name); |
296 if (data->param_name != NULL) g_free(data->param_name); | 296 g_free(data->param_name); |
297 if (data->account_name != NULL) g_free(data->account_name); | 297 g_free(data->account_name); |
298 | 298 |
299 g_free(data); | 299 g_free(data); |
300 } | 300 } |
301 | 301 |
302 static void | 302 static void |
496 else if (!strcmp(element_name, "pounce")) { | 496 else if (!strcmp(element_name, "pounce")) { |
497 data->pounce = NULL; | 497 data->pounce = NULL; |
498 data->events = 0; | 498 data->events = 0; |
499 data->options = 0; | 499 data->options = 0; |
500 | 500 |
501 if (data->ui_name != NULL) g_free(data->ui_name); | 501 g_free(data->ui_name); |
502 if (data->pouncee != NULL) g_free(data->pouncee); | 502 g_free(data->pouncee); |
503 if (data->protocol_id != NULL) g_free(data->protocol_id); | 503 g_free(data->protocol_id); |
504 if (data->event_type != NULL) g_free(data->event_type); | 504 g_free(data->event_type); |
505 if (data->option_type != NULL) g_free(data->option_type); | 505 g_free(data->option_type); |
506 if (data->action_name != NULL) g_free(data->action_name); | 506 g_free(data->action_name); |
507 if (data->param_name != NULL) g_free(data->param_name); | 507 g_free(data->param_name); |
508 if (data->account_name != NULL) g_free(data->account_name); | 508 g_free(data->account_name); |
509 | 509 |
510 data->ui_name = NULL; | 510 data->ui_name = NULL; |
511 data->pounce = NULL; | 511 data->pounce = NULL; |
512 data->protocol_id = NULL; | 512 data->protocol_id = NULL; |
513 data->event_type = NULL; | 513 data->event_type = NULL; |
650 | 650 |
651 handler = g_hash_table_lookup(pounce_handlers, pounce->ui_type); | 651 handler = g_hash_table_lookup(pounce_handlers, pounce->ui_type); |
652 | 652 |
653 pounces = g_list_remove(pounces, pounce); | 653 pounces = g_list_remove(pounces, pounce); |
654 | 654 |
655 if (pounce->ui_type != NULL) g_free(pounce->ui_type); | 655 g_free(pounce->ui_type); |
656 if (pounce->pouncee != NULL) g_free(pounce->pouncee); | 656 g_free(pounce->pouncee); |
657 | 657 |
658 g_hash_table_destroy(pounce->actions); | 658 g_hash_table_destroy(pounce->actions); |
659 | 659 |
660 if (handler != NULL && handler->free_pounce != NULL) | 660 if (handler != NULL && handler->free_pounce != NULL) |
661 handler->free_pounce(pounce); | 661 handler->free_pounce(pounce); |
721 gaim_pounce_set_pouncee(GaimPounce *pounce, const char *pouncee) | 721 gaim_pounce_set_pouncee(GaimPounce *pounce, const char *pouncee) |
722 { | 722 { |
723 g_return_if_fail(pounce != NULL); | 723 g_return_if_fail(pounce != NULL); |
724 g_return_if_fail(pouncee != NULL); | 724 g_return_if_fail(pouncee != NULL); |
725 | 725 |
726 if (pounce->pouncee != NULL) | 726 g_free(pounce->pouncee); |
727 g_free(pounce->pouncee); | |
728 | 727 |
729 pounce->pouncee = (pouncee == NULL ? NULL : g_strdup(pouncee)); | 728 pounce->pouncee = (pouncee == NULL ? NULL : g_strdup(pouncee)); |
730 | 729 |
731 schedule_pounces_save(); | 730 schedule_pounces_save(); |
732 } | 731 } |