diff libpurple/protocols/msn/contact.c @ 22808:f62a4a7fe365

Fix a number of leaks. As far as I can tell, MSNP14 now logs in without leaking.
author Daniel Atallah <daniel.atallah@gmail.com>
date Sat, 03 May 2008 23:51:43 +0000
parents 3c98c25b076b
children 5cdd93dac7a2 d756a0477c06
line wrap: on
line diff
--- a/libpurple/protocols/msn/contact.c	Sat May 03 21:03:13 2008 +0000
+++ b/libpurple/protocols/msn/contact.c	Sat May 03 23:51:43 2008 +0000
@@ -100,56 +100,46 @@
 void
 msn_callback_state_set_who(MsnCallbackState *state, const gchar *who)
 {
-	gchar *nval;
 	g_return_if_fail(state != NULL);
 
-	nval = g_strdup(who);
 	g_free(state->who);
-	state->who = nval;
+	state->who = g_strdup(who);
 }
 
 void
 msn_callback_state_set_uid(MsnCallbackState *state, const gchar *uid)
 {
-	gchar *nval;
 	g_return_if_fail(state != NULL);
 
-	nval = g_strdup(uid);
 	g_free(state->uid);
-	state->uid = nval;
+	state->uid = g_strdup(uid);
 }
 
 void
 msn_callback_state_set_old_group_name(MsnCallbackState *state, const gchar *old_group_name)
 {
-	gchar *nval;
 	g_return_if_fail(state != NULL);
 
-	nval = g_strdup(old_group_name);
 	g_free(state->old_group_name);
-	state->old_group_name = nval;
+	state->old_group_name = g_strdup(old_group_name);
 }
 
 void
 msn_callback_state_set_new_group_name(MsnCallbackState *state, const gchar *new_group_name)
 {
-	gchar *nval;
 	g_return_if_fail(state != NULL);
 
-	nval = g_strdup(new_group_name);
 	g_free(state->new_group_name);
-	state->new_group_name = nval;
+	state->new_group_name = g_strdup(new_group_name);
 }
 
 void
 msn_callback_state_set_guid(MsnCallbackState *state, const gchar *guid)
 {
-	gchar *nval;
 	g_return_if_fail(state != NULL);
 
-	nval = g_strdup(guid);
 	g_free(state->guid);
-	state->guid = nval;
+	state->guid = g_strdup(guid);
 }
 
 
@@ -539,6 +529,7 @@
 		g_free(Name);
 		g_free(uid);
 		g_free(type);
+		g_free(mobile_number);
 		passport = Name = uid = type = mobile_number = NULL;
 		mobile = FALSE;
 
@@ -660,6 +651,7 @@
 	g_free(Name);
 	g_free(uid);
 	g_free(type);
+	g_free(mobile_number);
 }
 
 static gboolean