changeset 15272:b3f5d5854017

[gaim-migrate @ 18062] Fix a crash. If we are redirected and then disconnected before _qq_got_login() gets called, we'd be trying to free already freed memory. committer: Tailor Script <tailor@pidgin.im>
author Mark Huetsch <markhuetsch>
date Wed, 27 Dec 2006 13:34:33 +0000
parents bc6f650b9c2d
children ca72c74bf5e3
files libgaim/protocols/qq/qq_proxy.c
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/libgaim/protocols/qq/qq_proxy.c	Wed Dec 27 13:27:55 2006 +0000
+++ b/libgaim/protocols/qq/qq_proxy.c	Wed Dec 27 13:34:33 2006 +0000
@@ -156,7 +156,6 @@
 	qd->logged_in = FALSE;
 	qd->channel = 1;
 	qd->uid = strtol(gaim_account_get_username(gaim_connection_get_account(gc)), NULL, 10);
-	qd->before_login_packets = g_queue_new();
 
 	/* now generate md5 processed passwd */
 	passwd = gaim_account_get_password(gaim_connection_get_account(gc));
@@ -432,6 +431,7 @@
 		gboolean use_tcp, gboolean is_redirect)
 {
 	GaimConnection *gc;
+	qq_data *qd;
 
 	g_return_val_if_fail(host != NULL, -1);
 	g_return_val_if_fail(port > 0, -1);
@@ -442,6 +442,9 @@
 	if (is_redirect)
 		_qq_common_clean(gc);
 
+	qd = (qq_data *) gc->proto_data;
+	qd->before_login_packets = g_queue_new();
+
 	return _proxy_connect_full(account, host, port, _qq_got_login, gc, use_tcp);
 }