comparison src/protocols/msn/msn.c @ 13479:90740e70af91

[gaim-migrate @ 15855] Patch from sadrul, expanded a bit by me, which fixes a crash when an MSN account disconnects while an msn_get_info() request is in progress and then completes after the disconnection. (Patch #1446189) committer: Tailor Script <tailor@pidgin.im>
author Evan Schoenberg <evan.s@dreskin.net>
date Thu, 09 Mar 2006 15:44:08 +0000
parents 9f95b44d561a
children 56898561b8a9
comparison
equal deleted inserted replaced
13478:38dcde2c8c4b 13479:90740e70af91
1450 MsnGetInfoStepTwoData *info2_data = NULL; 1450 MsnGetInfoStepTwoData *info2_data = NULL;
1451 #endif 1451 #endif
1452 1452
1453 gaim_debug_info("msn", "In msn_got_info\n"); 1453 gaim_debug_info("msn", "In msn_got_info\n");
1454 1454
1455 /* Make sure the connection is still valid */
1456 if (g_list_find(gaim_connections_get_all(), info_data->gc) == NULL)
1457 {
1458 gaim_debug_warning("msn", "invalid connection. ignoring buddy info.\n");
1459 g_free(info_data->name);
1460 g_free(info_data);
1461 return;
1462 }
1463
1455 tooltip_text = msn_tooltip_info_text(info_data); 1464 tooltip_text = msn_tooltip_info_text(info_data);
1456 title = _("MSN Profile"); 1465 title = _("MSN Profile");
1457 1466
1458 if (url_text == NULL || strcmp(url_text, "") == 0) 1467 if (url_text == NULL || strcmp(url_text, "") == 0)
1459 { 1468 {
1859 char *stripped = info2_data->stripped; 1868 char *stripped = info2_data->stripped;
1860 char *url_buffer = info2_data->url_buffer; 1869 char *url_buffer = info2_data->url_buffer;
1861 GString *s = info2_data->s; 1870 GString *s = info2_data->s;
1862 char *photo_url_text = info2_data->photo_url_text; 1871 char *photo_url_text = info2_data->photo_url_text;
1863 char *tooltip_text = info2_data->tooltip_text; 1872 char *tooltip_text = info2_data->tooltip_text;
1873
1874 /* Make sure the connection is still valid if we got here by fetching a photo url */
1875 if (url_text &&
1876 g_list_find(gaim_connections_get_all(), info_data->gc) == NULL)
1877 {
1878 gaim_debug_warning("msn", "invalid connection. ignoring buddy photo info.\n");
1879 g_free(stripped);
1880 g_free(url_buffer);
1881 g_string_free(s, TRUE);
1882 g_free(tooltip_text);
1883 g_free(info_data->name);
1884 g_free(info_data);
1885 #if PHOTO_SUPPORT
1886 g_free(photo_url_text);
1887 g_free(info2_data);
1888 #endif
1889 return;
1890 }
1864 1891
1865 /* Try to put the photo in there too, if there's one and is readable */ 1892 /* Try to put the photo in there too, if there's one and is readable */
1866 if (data && url_text && len != 0) 1893 if (data && url_text && len != 0)
1867 { 1894 {
1868 if (strstr(url_text, "400 Bad Request") 1895 if (strstr(url_text, "400 Bad Request")