changeset 27134:77cfaae36918

Need to make a copy of this because purple_util_fetch_url frees its.
author Paul Aurich <paul@darkrain42.org>
date Sun, 21 Jun 2009 21:26:59 +0000
parents 37ace0f4d63c
children 54de7746e148
files libpurple/protocols/jabber/useravatar.c
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/jabber/useravatar.c	Sun Jun 21 17:30:13 2009 +0000
+++ b/libpurple/protocols/jabber/useravatar.c	Sun Jun 21 21:26:59 2009 +0000
@@ -257,6 +257,8 @@
                                gsize len, const gchar *error_message)
 {
 	JabberBuddyAvatarUpdateURLInfo *info = user_data;
+	gpointer icon_data;
+
 	if(!url_text) {
 		purple_debug(PURPLE_DEBUG_ERROR, "jabber",
 		             "do_buddy_avatar_update_fromurl got error \"%s\"",
@@ -264,7 +266,8 @@
 		goto out;
 	}
 
-	purple_buddy_icons_set_for_user(purple_connection_get_account(info->js->gc), info->from, (void*)url_text, len, info->id);
+	icon_data = g_memdup(url_text, len);
+	purple_buddy_icons_set_for_user(purple_connection_get_account(info->js->gc), info->from, icon_data, len, info->id);
 
 out:
 	g_free(info->from);