diff libgaim/protocols/qq/login_logout.c @ 14656:d1a76ccb93c4

[gaim-migrate @ 17402] leak-be-gone committer: Tailor Script <tailor@pidgin.im>
author Mark Huetsch <markhuetsch>
date Sat, 30 Sep 2006 00:14:00 +0000
parents 108152f29f37
children 478e64cf96fe
line wrap: on
line diff
--- a/libgaim/protocols/qq/login_logout.c	Fri Sep 29 20:49:33 2006 +0000
+++ b/libgaim/protocols/qq/login_logout.c	Sat Sep 30 00:14:00 2006 +0000
@@ -377,6 +377,7 @@
 void qq_process_request_login_token_reply(guint8 *buf, gint buf_len, GaimConnection *gc)
 {
         qq_data *qd;
+	gchar *hex_dump;
 
         g_return_if_fail(buf != NULL && buf_len != 0);
 
@@ -389,17 +390,20 @@
 			gaim_debug(GAIM_DEBUG_INFO, "QQ",
 					"Attempting to proceed with the actual packet length.\n");
 		}
+		hex_dump = hex_dump_to_str(buf+2, buf_len-2);
 		gaim_debug(GAIM_DEBUG_INFO, "QQ",
-                                   "<<< got a token with %d bytes -> [default] decrypt and dump\n%s",buf_len-2, hex_dump_to_str(buf+2, buf_len-2));
+                                   "<<< got a token with %d bytes -> [default] decrypt and dump\n%s", buf_len-2, hex_dump);
 		qq_send_packet_login(gc, buf_len-2, buf+2);
 	} else {
 		gaim_debug(GAIM_DEBUG_ERROR, "QQ", "Unknown request login token reply code : %d\n", buf[0]);
+		hex_dump = hex_dump_to_str(buf, buf_len);
                 gaim_debug(GAIM_DEBUG_WARNING, "QQ",
            		           ">>> %d bytes -> [default] decrypt and dump\n%s",
-	                           buf_len, hex_dump_to_str(buf, buf_len));
+	                           buf_len, hex_dump);
                		try_dump_as_gbk(buf, buf_len);
 		gaim_connection_error(gc, _("Request login token error!"));
 	}		
+	g_free(hex_dump);
 }
 
 /* send logout packets to QQ server */
@@ -421,6 +425,7 @@
 	gint len, ret, bytes;
 	guint8 *data;
 	qq_data *qd;
+	gchar *hex_dump;
 
 	g_return_if_fail(buf != NULL && buf_len != 0);
 
@@ -453,9 +458,11 @@
 				break;
 			default:
 				gaim_debug(GAIM_DEBUG_ERROR, "QQ", "Unknown reply code: %d\n", data[0]);
+				hex_dump = hex_dump_to_str(data, len);
 		                gaim_debug(GAIM_DEBUG_WARNING, "QQ",
                 		           ">>> %d bytes -> [default] decrypt and dump\n%s",
-		                           buf_len, hex_dump_to_str(data, len));
+		                           buf_len, hex_dump);
+				g_free(hex_dump);
                 		try_dump_as_gbk(data, len);
 
 				ret = QQ_LOGIN_REPLY_MISC_ERROR;