changeset 30676:43cf75e21702

Don't leak the Endpoint ID.
author Elliott Sales de Andrade <qulogic@pidgin.im>
date Mon, 14 Dec 2009 07:15:24 +0000
parents a4c45a92938d
children e9c6be9e0ddf
files libpurple/protocols/msn/user.c
diffstat 1 files changed, 11 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/msn/user.c	Mon Dec 14 07:11:03 2009 +0000
+++ b/libpurple/protocols/msn/user.c	Mon Dec 14 07:15:24 2009 +0000
@@ -25,6 +25,8 @@
 #include "user.h"
 #include "slp.h"
 
+static void free_user_endpoint(MsnUserEndpoint *data);
+
 /*new a user object*/
 MsnUser *
 msn_user_new(MsnUserList *userlist, const char *passport,
@@ -39,7 +41,8 @@
 	msn_user_set_passport(user, passport);
 	msn_user_set_friendly_name(user, friendly_name);
 
-	user->endpoints = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, g_free);
+	user->endpoints = g_hash_table_new_full(g_str_hash, g_str_equal,
+	                                        g_free, (GDestroyNotify)free_user_endpoint);
 
 	return user;
 }
@@ -236,6 +239,13 @@
 	user->uid = g_strdup(uid);
 }
 
+static void
+free_user_endpoint(MsnUserEndpoint *data)
+{
+	g_free(data->id);
+	g_free(data);
+}
+
 void
 msn_user_set_endpoint_data(MsnUser *user, const char *endpoint, MsnUserEndpoint *data)
 {