changeset 22450:57fef22fa7a8

Fix a memory leak
author Stu Tomlinson <stu@nosnilmot.com>
date Wed, 12 Mar 2008 01:34:40 +0000
parents 4baa8b7ad5b4
children a0608437ee61
files pidgin/gtkblist.c
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/pidgin/gtkblist.c	Tue Mar 11 23:00:03 2008 +0000
+++ b/pidgin/gtkblist.c	Wed Mar 12 01:34:40 2008 +0000
@@ -3132,7 +3132,6 @@
 		GList *cur;
 		struct proto_chat_entry *pce;
 		char *name, *value;
-		const char *chat_name;
 		PurpleConversation *conv;
 		PidginBlistNode *bnode = node->ui_data;
 
@@ -3150,13 +3149,15 @@
 		if (bnode && bnode->conv.conv) {
 			conv = bnode->conv.conv;
 		} else {
+			char *chat_name;
 			if (prpl_info && prpl_info->get_chat_name)
 				chat_name = prpl_info->get_chat_name(chat->components);
 			else
-				chat_name = purple_chat_get_name(chat);
+				chat_name = g_strdup(purple_chat_get_name(chat));
 
 			conv = purple_find_conversation_with_account(PURPLE_CONV_TYPE_CHAT, chat_name,
 					chat->account);
+			g_free(chat_name);
 		}
 		if (conv && prpl_info && (prpl_info->options & OPT_PROTO_CHAT_TOPIC) &&
 				!purple_conv_chat_has_left(PURPLE_CONV_CHAT(conv))) {