comparison src/protocols/jabber/jabber.c @ 13894:b9404076ef67

[gaim-migrate @ 16377] Fix a crash bug pointed out by Alexander Sashnov: There is another segfault (on today SVN trunk version). Steps for reproduce: 1. Create jabber account with incorrect params, check it for connect on start up; 2. run Gaim again. It will not connect and see error message in bottom of users list; 3. Open 'accounts' dialog and deselect this account..... segfault :-) committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Fri, 30 Jun 2006 06:58:17 +0000
parents 25e63008d3bb
children 46be62b128c7
comparison
equal deleted inserted replaced
13893:ab671b76fb96 13894:b9404076ef67
479 gaim_connection_error(js->gc, _("Unable to create socket")); 479 gaim_connection_error(js->gc, _("Unable to create socket"));
480 } 480 }
481 481
482 static void srv_resolved_cb(GaimSrvResponse *resp, int results, gpointer data) 482 static void srv_resolved_cb(GaimSrvResponse *resp, int results, gpointer data)
483 { 483 {
484 JabberStream *js = (JabberStream*)data; 484 GaimConnection *gc;
485 JabberStream *js;
486
487 gc = data;
488 if (!g_list_find(gaim_connections_get_all(), gc))
489 {
490 /* This connection has been closed */
491 g_free(resp);
492 return;
493 }
494
495 js = (JabberStream*)gc->proto_data;
485 496
486 if(results) { 497 if(results) {
487 jabber_login_connect(js, resp->hostname, resp->port); 498 jabber_login_connect(js, resp->hostname, resp->port);
488 g_free(resp); 499 g_free(resp);
489 } else { 500 } else {
559 * invoke the magic of SRV lookups, to figure out host and port */ 570 * invoke the magic of SRV lookups, to figure out host and port */
560 if(!js->gsc) { 571 if(!js->gsc) {
561 if(connect_server[0]) { 572 if(connect_server[0]) {
562 jabber_login_connect(js, connect_server, gaim_account_get_int(account, "port", 5222)); 573 jabber_login_connect(js, connect_server, gaim_account_get_int(account, "port", 5222));
563 } else { 574 } else {
564 gaim_srv_resolve("xmpp-client", "tcp", js->user->domain, srv_resolved_cb, js); 575 gaim_srv_resolve("xmpp-client", "tcp", js->user->domain, srv_resolved_cb, gc);
565 } 576 }
566 } 577 }
567 } 578 }
568 579
569 580