changeset 21115:b95550f14549

initialize a variable to NULL, and not crash when you move a buddy to a new group. Doesn't do the right thing yet, but at least doesn't crash
author Ka-Hing Cheung <khc@hxbc.us>
date Sat, 03 Nov 2007 05:37:59 +0000
parents 598fb854c1f5
children a3dc160d7914
files libpurple/protocols/msn/contact.c libpurple/protocols/msn/soap2.c
diffstat 2 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/msn/contact.c	Sat Nov 03 05:29:34 2007 +0000
+++ b/libpurple/protocols/msn/contact.c	Sat Nov 03 05:37:59 2007 +0000
@@ -1277,16 +1277,16 @@
 				purple_debug_info("MSNCL", "Adding group %s with guid = %s to the userlist\n", state->new_group_name, guid);
 				msn_group_new(session->userlist, guid, state->new_group_name);
 
+				g_free(guid);
+
 				if (state->action & MSN_ADD_BUDDY) {
 					msn_userlist_add_buddy(session->userlist,
 						state->who,
 						state->new_group_name);
-					msn_callback_state_free(state);
 				} else if (state->action & MSN_MOVE_BUDDY) {
 					msn_add_contact_to_group(session->contact, state, state->who, guid); 
+					return;
 				}
-
-				g_free(guid);
 			} else {
 				purple_debug_info("MSNCL", "Adding group %s failed\n",
 					state->new_group_name);
--- a/libpurple/protocols/msn/soap2.c	Sat Nov 03 05:29:34 2007 +0000
+++ b/libpurple/protocols/msn/soap2.c	Sat Nov 03 05:37:59 2007 +0000
@@ -648,7 +648,7 @@
 xmlnode *
 msn_soap_xml_get(xmlnode *parent, const char *node)
 {
-	xmlnode *ret;
+	xmlnode *ret = NULL;
 	char **tokens = g_strsplit(node, "/", -1);
 	int i;