aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPhilipp Tölke <toelke@in.tum.de>2010-11-17 08:55:34 +0000
committerPhilipp Tölke <toelke@in.tum.de>2010-11-17 08:55:34 +0000
commit4c2e35606e6c4cd5d51428bf0a4ee9c62d8e2f20 (patch)
tree0963343f088233f7e9d2918db66fdc01f18df28a /src
parentf91ab8c55ff0ce6fb18701a361e2da9bd372f950 (diff)
downloadgnunet-4c2e35606e6c4cd5d51428bf0a4ee9c62d8e2f20.tar.gz
gnunet-4c2e35606e6c4cd5d51428bf0a4ee9c62d8e2f20.zip
Fix memory-leak (and superfluous copy)
Diffstat (limited to 'src')
-rw-r--r--src/vpn/gnunet-daemon-vpn.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/vpn/gnunet-daemon-vpn.c b/src/vpn/gnunet-daemon-vpn.c
index f447eaf41..a2d43fb2f 100644
--- a/src/vpn/gnunet-daemon-vpn.c
+++ b/src/vpn/gnunet-daemon-vpn.c
@@ -422,11 +422,14 @@ message_token(void *cls,
422 break; 422 break;
423 case 0x3a: 423 case 0x3a:
424 /* ICMPv6 */ 424 /* ICMPv6 */
425 pkt6_icmp = GNUNET_malloc(ntohs(pkt6->shdr.size)); 425 pkt6_icmp = (struct ip6_icmp*)pkt6;
426 memcpy(pkt6_icmp, pkt6, ntohs(pkt6->shdr.size));
427 /* If this packet is an icmp-echo-request and a mapping exists, answer */ 426 /* If this packet is an icmp-echo-request and a mapping exists, answer */
428 if (pkt6_icmp->icmp_hdr.type == 0x80 && address_mapping_exists(pkt6->ip6_hdr.sadr)) 427 if (pkt6_icmp->icmp_hdr.type == 0x80 && address_mapping_exists(pkt6->ip6_hdr.sadr))
428 {
429 pkt6_icmp = GNUNET_malloc(ntohs(pkt6->shdr.size));
430 memcpy(pkt6_icmp, pkt6, ntohs(pkt6->shdr.size));
429 GNUNET_SCHEDULER_add_now(&send_icmp_response, pkt6_icmp); 431 GNUNET_SCHEDULER_add_now(&send_icmp_response, pkt6_icmp);
432 }
430 break; 433 break;
431 } 434 }
432 } 435 }