comparison libpurple/protocols/silc/chat.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 665e04562de0
children 29235834c692
comparison
equal deleted inserted replaced
22799:fc1e708ddf92 22800:67a4c8c46f78
90 static void 90 static void
91 silcpurple_chat_getinfo(PurpleConnection *gc, GHashTable *components) 91 silcpurple_chat_getinfo(PurpleConnection *gc, GHashTable *components)
92 { 92 {
93 SilcPurple sg = gc->proto_data; 93 SilcPurple sg = gc->proto_data;
94 const char *chname; 94 const char *chname;
95 char *buf, tmp[256], *tmp2; 95 char tmp[256], *tmp2;
96 GString *s; 96 GString *s;
97 SilcChannelEntry channel; 97 SilcChannelEntry channel;
98 SilcHashTableList htl; 98 SilcHashTableList htl;
99 SilcChannelUser chu; 99 SilcChannelUser chu;
100 100
171 silc_free(babbleprint); 171 silc_free(babbleprint);
172 silc_free(pk); 172 silc_free(pk);
173 } 173 }
174 } 174 }
175 175
176 buf = g_string_free(s, FALSE); 176 purple_notify_formatted(gc, NULL, _("Channel Information"), NULL, s->str, NULL, NULL);
177 purple_notify_formatted(gc, NULL, _("Channel Information"), NULL, buf, NULL, NULL); 177 g_string_free(s, TRUE);
178 g_free(buf);
179 } 178 }
180 179
181 180
182 static void 181 static void
183 silcpurple_chat_getinfo_menu(PurpleBlistNode *node, gpointer data) 182 silcpurple_chat_getinfo_menu(PurpleBlistNode *node, gpointer data)
687 if (limit) 686 if (limit)
688 ulimit = atoi(limit); 687 ulimit = atoi(limit);
689 688
690 if (!limit || !(*limit) || *limit == '0') { 689 if (!limit || !(*limit) || *limit == '0') {
691 if (limit && ulimit == channel->user_limit) { 690 if (limit && ulimit == channel->user_limit) {
691 g_free(s->channel);
692 silc_free(s); 692 silc_free(s);
693 return; 693 return;
694 } 694 }
695 silc_client_command_call(s->sg->client, s->sg->conn, NULL, "CMODE", 695 silc_client_command_call(s->sg->client, s->sg->conn, NULL, "CMODE",
696 s->channel, "-l", NULL); 696 s->channel, "-l", NULL);
697 697
698 g_free(s->channel);
698 silc_free(s); 699 silc_free(s);
699 return; 700 return;
700 } 701 }
701 702
702 if (ulimit == channel->user_limit) { 703 if (ulimit == channel->user_limit) {
704 g_free(s->channel);
703 silc_free(s); 705 silc_free(s);
704 return; 706 return;
705 } 707 }
706 708
707 /* Call CMODE */ 709 /* Call CMODE */
708 silc_client_command_call(s->sg->client, s->sg->conn, NULL, "CMODE", 710 silc_client_command_call(s->sg->client, s->sg->conn, NULL, "CMODE",
709 s->channel, "+l", limit, NULL); 711 s->channel, "+l", limit, NULL);
710 712
713 g_free(s->channel);
711 silc_free(s); 714 silc_free(s);
712 } 715 }
713 716
714 static void 717 static void
715 silcpurple_chat_ulimit(PurpleBlistNode *node, gpointer data) 718 silcpurple_chat_ulimit(PurpleBlistNode *node, gpointer data)