comparison libpurple/protocols/yahoo/libymsg.c @ 30635:c4cbe5f992ce

Initialize pointer, fix a typo to fix a crash.
author Sadrul Habib Chowdhury <imadil@gmail.com>
date Thu, 17 Jun 2010 22:21:53 +0000
parents 33989e3a449b
children 490707649f29
comparison
equal deleted inserted replaced
30632:545ce15b619f 30635:c4cbe5f992ce
400 { 400 {
401 PurpleBuddy *b; 401 PurpleBuddy *b;
402 PurpleGroup *g; 402 PurpleGroup *g;
403 GSList *list, *i; 403 GSList *list, *i;
404 gboolean onlist = FALSE; 404 gboolean onlist = FALSE;
405 char *oname; 405 char *oname = NULL;
406 406
407 if (g_hash_table_lookup_extended(ht, purple_normalize(account, name), (gpointer *)&oname, (gpointer *)&list)) 407 if (g_hash_table_lookup_extended(ht, purple_normalize(account, name), (gpointer *)&oname, (gpointer *)&list))
408 g_hash_table_steal(ht, oname); 408 g_hash_table_steal(ht, name);
409 else 409 else
410 list = purple_find_buddies(account, name); 410 list = purple_find_buddies(account, name);
411 411
412 for (i = list; i; i = i->next) { 412 for (i = list; i; i = i->next) {
413 b = i->data; 413 b = i->data;
839 break; 839 break;
840 case YAHOO_FEDERATION_NONE: 840 case YAHOO_FEDERATION_NONE:
841 default: 841 default:
842 break; 842 break;
843 } 843 }
844 844
845 if (*stat == '1') 845 if (*stat == '1')
846 serv_got_typing(gc, fed_from, 0, PURPLE_TYPING); 846 serv_got_typing(gc, fed_from, 0, PURPLE_TYPING);
847 else 847 else
848 serv_got_typing_stopped(gc, fed_from); 848 serv_got_typing_stopped(gc, fed_from);
849 849
850 if (fed_from != from) 850 if (fed_from != from)
851 g_free(fed_from); 851 g_free(fed_from);
852
853 } else if (!g_ascii_strncasecmp(msg, "GAME", strlen("GAME"))) { 852 } else if (!g_ascii_strncasecmp(msg, "GAME", strlen("GAME"))) {
854 PurpleBuddy *bud = purple_find_buddy(account, from); 853 PurpleBuddy *bud = purple_find_buddy(account, from);
855 854
856 if (!bud) { 855 if (!bud) {
857 purple_debug_warning("yahoo", 856 purple_debug_warning("yahoo",
1010 default: 1009 default:
1011 im->fed_from = g_strdup(im->from); 1010 im->fed_from = g_strdup(im->from);
1012 break; 1011 break;
1013 } 1012 }
1014 purple_debug_info("yahoo", "Message from federated (%d) buddy %s.\n", im->fed, im->fed_from); 1013 purple_debug_info("yahoo", "Message from federated (%d) buddy %s.\n", im->fed, im->fed_from);
1015
1016 } 1014 }
1017 /* peer session id */ 1015 /* peer session id */
1018 if (im && (pair->key == 11)) { 1016 if (im && (pair->key == 11)) {
1019 /* disconnect the peer if connected through p2p and sends wrong value for session id */ 1017 /* disconnect the peer if connected through p2p and sends wrong value for session id */
1020 if( (im->fed == YAHOO_FEDERATION_NONE) && (pkt_type == YAHOO_PKT_TYPE_P2P) 1018 if( (im->fed == YAHOO_FEDERATION_NONE) && (pkt_type == YAHOO_PKT_TYPE_P2P)