comparison libpurple/protocols/msn/contact.c @ 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 d0676f639d5a
comparison
equal deleted inserted replaced
21114:598fb854c1f5 21115:b95550f14549
1275 1275
1276 /* create and add the new group to the userlist */ 1276 /* create and add the new group to the userlist */
1277 purple_debug_info("MSNCL", "Adding group %s with guid = %s to the userlist\n", state->new_group_name, guid); 1277 purple_debug_info("MSNCL", "Adding group %s with guid = %s to the userlist\n", state->new_group_name, guid);
1278 msn_group_new(session->userlist, guid, state->new_group_name); 1278 msn_group_new(session->userlist, guid, state->new_group_name);
1279 1279
1280 g_free(guid);
1281
1280 if (state->action & MSN_ADD_BUDDY) { 1282 if (state->action & MSN_ADD_BUDDY) {
1281 msn_userlist_add_buddy(session->userlist, 1283 msn_userlist_add_buddy(session->userlist,
1282 state->who, 1284 state->who,
1283 state->new_group_name); 1285 state->new_group_name);
1284 msn_callback_state_free(state);
1285 } else if (state->action & MSN_MOVE_BUDDY) { 1286 } else if (state->action & MSN_MOVE_BUDDY) {
1286 msn_add_contact_to_group(session->contact, state, state->who, guid); 1287 msn_add_contact_to_group(session->contact, state, state->who, guid);
1288 return;
1287 } 1289 }
1288
1289 g_free(guid);
1290 } else { 1290 } else {
1291 purple_debug_info("MSNCL", "Adding group %s failed\n", 1291 purple_debug_info("MSNCL", "Adding group %s failed\n",
1292 state->new_group_name); 1292 state->new_group_name);
1293 } 1293 }
1294 } 1294 }