Mercurial > pidgin.yaz
comparison libpurple/protocols/silc/ops.c @ 22800:67a4c8c46f78
Cleanup allocations/frees to match and plug some leaks.
author | Daniel Atallah <daniel.atallah@gmail.com> |
---|---|
date | Sat, 03 May 2008 07:13:58 +0000 |
parents | bb7b11ca28ca |
children | e0bcb8cfda74 |
comparison
equal
deleted
inserted
replaced
22799:fc1e708ddf92 | 22800:67a4c8c46f78 |
---|---|
460 (void)va_arg(va, SilcChannelEntry); | 460 (void)va_arg(va, SilcChannelEntry); |
461 name = va_arg(va, char *); | 461 name = va_arg(va, char *); |
462 client_entry = va_arg(va, SilcClientEntry); | 462 client_entry = va_arg(va, SilcClientEntry); |
463 | 463 |
464 components = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, g_free); | 464 components = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, g_free); |
465 g_hash_table_insert(components, strdup("channel"), strdup(name)); | 465 g_hash_table_insert(components, g_strdup("channel"), g_strdup(name)); |
466 serv_got_chat_invite(gc, name, client_entry->nickname, NULL, components); | 466 serv_got_chat_invite(gc, name, client_entry->nickname, NULL, components); |
467 } | 467 } |
468 break; | 468 break; |
469 | 469 |
470 case SILC_NOTIFY_TYPE_JOIN: | 470 case SILC_NOTIFY_TYPE_JOIN: |
482 | 482 |
483 /* Join user to channel */ | 483 /* Join user to channel */ |
484 g_snprintf(buf, sizeof(buf), "%s@%s", | 484 g_snprintf(buf, sizeof(buf), "%s@%s", |
485 client_entry->username, client_entry->hostname); | 485 client_entry->username, client_entry->hostname); |
486 purple_conv_chat_add_user(PURPLE_CONV_CHAT(convo), | 486 purple_conv_chat_add_user(PURPLE_CONV_CHAT(convo), |
487 g_strdup(client_entry->nickname), buf, PURPLE_CBFLAGS_NONE, TRUE); | 487 client_entry->nickname, buf, PURPLE_CBFLAGS_NONE, TRUE); |
488 | 488 |
489 break; | 489 break; |
490 | 490 |
491 case SILC_NOTIFY_TYPE_LEAVE: | 491 case SILC_NOTIFY_TYPE_LEAVE: |
492 client_entry = va_arg(va, SilcClientEntry); | 492 client_entry = va_arg(va, SilcClientEntry); |
972 static void | 972 static void |
973 silcpurple_whois_more(SilcClientEntry client_entry, gint id) | 973 silcpurple_whois_more(SilcClientEntry client_entry, gint id) |
974 { | 974 { |
975 SilcAttributePayload attr; | 975 SilcAttributePayload attr; |
976 SilcAttribute attribute; | 976 SilcAttribute attribute; |
977 char *buf; | |
978 GString *s; | 977 GString *s; |
979 SilcVCardStruct vcard; | 978 SilcVCardStruct vcard; |
980 int i; | 979 int i; |
981 | 980 |
982 if (id != 0) | 981 if (id != 0) |
1062 vcard.note); | 1061 vcard.note); |
1063 break; | 1062 break; |
1064 } | 1063 } |
1065 } | 1064 } |
1066 | 1065 |
1067 buf = g_string_free(s, FALSE); | |
1068 purple_notify_info(NULL, _("User Information"), _("User Information"), | 1066 purple_notify_info(NULL, _("User Information"), _("User Information"), |
1069 buf); | 1067 s->str); |
1070 g_free(buf); | 1068 g_string_free(s, TRUE); |
1071 } | 1069 } |
1072 #endif | 1070 #endif |
1073 | 1071 |
1074 | 1072 |
1075 /* Command reply handler. Delivers a reply to command that was sent | 1073 /* Command reply handler. Delivers a reply to command that was sent |
1131 | 1129 |
1132 if (chu->mode & SILC_CHANNEL_UMODE_CHANFO) | 1130 if (chu->mode & SILC_CHANNEL_UMODE_CHANFO) |
1133 f |= PURPLE_CBFLAGS_FOUNDER; | 1131 f |= PURPLE_CBFLAGS_FOUNDER; |
1134 if (chu->mode & SILC_CHANNEL_UMODE_CHANOP) | 1132 if (chu->mode & SILC_CHANNEL_UMODE_CHANOP) |
1135 f |= PURPLE_CBFLAGS_OP; | 1133 f |= PURPLE_CBFLAGS_OP; |
1136 users = g_list_append(users, g_strdup(chu->client->nickname)); | 1134 users = g_list_append(users, chu->client->nickname); |
1137 flags = g_list_append(flags, GINT_TO_POINTER(f)); | 1135 flags = g_list_append(flags, GINT_TO_POINTER(f)); |
1138 | 1136 |
1139 if (chu->mode & SILC_CHANNEL_UMODE_CHANFO) { | 1137 if (chu->mode & SILC_CHANNEL_UMODE_CHANFO) { |
1140 if (chu->client == conn->local_entry) | 1138 if (chu->client == conn->local_entry) |
1141 g_snprintf(tmp, sizeof(tmp), | 1139 g_snprintf(tmp, sizeof(tmp), |