# HG changeset patch # User Evan Schoenberg # Date 1141919048 0 # Node ID 90740e70af91208c865ea7a6d5e3de5581f5d002 # Parent 38dcde2c8c4ba2af5cec9aed795b13e963768f14 [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 diff -r 38dcde2c8c4b -r 90740e70af91 src/protocols/msn/msn.c --- a/src/protocols/msn/msn.c Thu Mar 09 06:26:16 2006 +0000 +++ b/src/protocols/msn/msn.c Thu Mar 09 15:44:08 2006 +0000 @@ -1452,6 +1452,15 @@ gaim_debug_info("msn", "In msn_got_info\n"); + /* Make sure the connection is still valid */ + if (g_list_find(gaim_connections_get_all(), info_data->gc) == NULL) + { + gaim_debug_warning("msn", "invalid connection. ignoring buddy info.\n"); + g_free(info_data->name); + g_free(info_data); + return; + } + tooltip_text = msn_tooltip_info_text(info_data); title = _("MSN Profile"); @@ -1862,6 +1871,24 @@ char *photo_url_text = info2_data->photo_url_text; char *tooltip_text = info2_data->tooltip_text; + /* Make sure the connection is still valid if we got here by fetching a photo url */ + if (url_text && + g_list_find(gaim_connections_get_all(), info_data->gc) == NULL) + { + gaim_debug_warning("msn", "invalid connection. ignoring buddy photo info.\n"); + g_free(stripped); + g_free(url_buffer); + g_string_free(s, TRUE); + g_free(tooltip_text); + g_free(info_data->name); + g_free(info_data); +#if PHOTO_SUPPORT + g_free(photo_url_text); + g_free(info2_data); +#endif + return; + } + /* Try to put the photo in there too, if there's one and is readable */ if (data && url_text && len != 0) {