comparison pidgin/gtkblist.c @ 22450:57fef22fa7a8

Fix a memory leak
author Stu Tomlinson <stu@nosnilmot.com>
date Wed, 12 Mar 2008 01:34:40 +0000
parents 8802eddbfedc
children ed786719b10a
comparison
equal deleted inserted replaced
22449:4baa8b7ad5b4 22450:57fef22fa7a8
3130 { 3130 {
3131 PurpleChat *chat; 3131 PurpleChat *chat;
3132 GList *cur; 3132 GList *cur;
3133 struct proto_chat_entry *pce; 3133 struct proto_chat_entry *pce;
3134 char *name, *value; 3134 char *name, *value;
3135 const char *chat_name;
3136 PurpleConversation *conv; 3135 PurpleConversation *conv;
3137 PidginBlistNode *bnode = node->ui_data; 3136 PidginBlistNode *bnode = node->ui_data;
3138 3137
3139 chat = (PurpleChat *)node; 3138 chat = (PurpleChat *)node;
3140 prpl = purple_find_prpl(purple_account_get_protocol_id(chat->account)); 3139 prpl = purple_find_prpl(purple_account_get_protocol_id(chat->account));
3148 } 3147 }
3149 3148
3150 if (bnode && bnode->conv.conv) { 3149 if (bnode && bnode->conv.conv) {
3151 conv = bnode->conv.conv; 3150 conv = bnode->conv.conv;
3152 } else { 3151 } else {
3152 char *chat_name;
3153 if (prpl_info && prpl_info->get_chat_name) 3153 if (prpl_info && prpl_info->get_chat_name)
3154 chat_name = prpl_info->get_chat_name(chat->components); 3154 chat_name = prpl_info->get_chat_name(chat->components);
3155 else 3155 else
3156 chat_name = purple_chat_get_name(chat); 3156 chat_name = g_strdup(purple_chat_get_name(chat));
3157 3157
3158 conv = purple_find_conversation_with_account(PURPLE_CONV_TYPE_CHAT, chat_name, 3158 conv = purple_find_conversation_with_account(PURPLE_CONV_TYPE_CHAT, chat_name,
3159 chat->account); 3159 chat->account);
3160 g_free(chat_name);
3160 } 3161 }
3161 if (conv && prpl_info && (prpl_info->options & OPT_PROTO_CHAT_TOPIC) && 3162 if (conv && prpl_info && (prpl_info->options & OPT_PROTO_CHAT_TOPIC) &&
3162 !purple_conv_chat_has_left(PURPLE_CONV_CHAT(conv))) { 3163 !purple_conv_chat_has_left(PURPLE_CONV_CHAT(conv))) {
3163 char *topic = g_markup_escape_text(purple_conv_chat_get_topic(PURPLE_CONV_CHAT(conv)), -1); 3164 char *topic = g_markup_escape_text(purple_conv_chat_get_topic(PURPLE_CONV_CHAT(conv)), -1);
3164 g_string_append_printf(str, _("\n<b>Topic:</b> %s"), topic ? topic : _("(no topic set)")); 3165 g_string_append_printf(str, _("\n<b>Topic:</b> %s"), topic ? topic : _("(no topic set)"));