changeset 31143:3b8e763fb133

We don't pack P2P header or footer, so this memdup won't work.
author Elliott Sales de Andrade <qulogic@pidgin.im>
date Tue, 11 Jan 2011 05:24:33 +0000
parents dcd407e6c004
children cc282e31e5c8
files libpurple/protocols/msn/slpmsg_part.c
diffstat 1 files changed, 8 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/msn/slpmsg_part.c	Tue Jan 11 04:46:53 2011 +0000
+++ b/libpurple/protocols/msn/slpmsg_part.c	Tue Jan 11 05:24:33 2011 +0000
@@ -34,10 +34,14 @@
 
 	part = g_new0(MsnSlpMessagePart, 1);
 
-	if (header)
-		part->header = g_memdup(header, P2P_PACKET_HEADER_SIZE);
-	if (footer)
-		part->footer = g_memdup(footer, P2P_PACKET_FOOTER_SIZE);
+	if (header) {
+		part->header = g_new0(MsnP2PHeader, 1);
+		*part->header = *header;
+	}
+	if (footer) {
+		part->footer = g_new0(MsnP2PFooter, 1);
+		*part->footer = *footer;
+	}
 
 	part->ack_cb = msn_slpmsgpart_ack;
 	part->nak_cb = msn_slpmsgpart_nak;