cpw.qulogic.msnp16: b93b9f00: Don't leak the Endpoint ID.

qulogic at pidgin.im qulogic at pidgin.im
Mon Dec 14 02:28:05 EST 2009


-----------------------------------------------------------------
Revision: b93b9f007b907df6cc4938bf4c9a065df4a7783a
Ancestor: 7fab3097df7de096ab993f4992b1f8f7af78922d
Author: qulogic at pidgin.im
Date: 2009-12-14T07:15:24
Branch: im.pidgin.cpw.qulogic.msnp16
URL: http://d.pidgin.im/viewmtn/revision/info/b93b9f007b907df6cc4938bf4c9a065df4a7783a

Modified files:
        libpurple/protocols/msn/user.c

ChangeLog: 

Don't leak the Endpoint ID.

-------------- next part --------------
============================================================
--- libpurple/protocols/msn/user.c	4660ed90ed24c35fd611941095eb7043fe19227e
+++ libpurple/protocols/msn/user.c	753e4f9340fc171ad04b2028316dcd9e5447b6a4
@@ -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_new(MsnUserList *userlist, cons
 	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 @@ msn_user_set_uid(MsnUser *user, const ch
 	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)
 {


More information about the Commits mailing list