# HG changeset patch # User Christian Hammond # Date 1055705039 0 # Node ID e3733414ca08ee5f38f8bfe026665ca18a4a49c1 # Parent a156d08e481e8abad76a96cad20976fcf36e5571 [gaim-migrate @ 6329] Fixed the MSN segfault on XFR, where we were accessing a servconn that was destroyed, due to it being the old notification server that was replaced during XFR. Did that make sense to anybody? committer: Tailor Script diff -r a156d08e481e -r e3733414ca08 src/protocols/msn/servconn.c --- a/src/protocols/msn/servconn.c Sun Jun 15 18:22:11 2003 +0000 +++ b/src/protocols/msn/servconn.c Sun Jun 15 19:23:59 2003 +0000 @@ -54,15 +54,19 @@ static gboolean process_single_line(MsnServConn *servconn, char *str) { + MsnSession *session = servconn->session; MsnServConnCommandCb cb; - GSList *l, *l_next; + GSList *l, *l_next = NULL; gboolean result; size_t param_count = 0; char *command, *param_start; char **params = NULL; + MsnServConn *old_notification_conn; command = str; + old_notification_conn = session->notification_conn; + /** * See how many spaces we have in this. */ @@ -98,7 +102,19 @@ if (params != NULL) g_strfreev(params); - + /* + * We're checking here if the old notification server was replaced + * with a new one, and if the current servconn here is the old + * notification server. If so, we're going to have a bit of trouble + * in the upcoming loop, as servconn will be a freed variable, so + * we'll just return early. + */ + if (servconn == old_notification_conn && + old_notification_conn != session->notification_conn) { + + return result; + } + /* Process all queued messages that are waiting on this command. */ for (l = servconn->msg_queue; l != NULL; l = l_next) { MsnQueueEntry *entry = l->data;