summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorAlexander Bluhm <bluhm@cvs.openbsd.org>2017-05-22 14:26:09 +0000
committerAlexander Bluhm <bluhm@cvs.openbsd.org>2017-05-22 14:26:09 +0000
commit667f23b359aab3138f4c7bb2d3455ae740655e01 (patch)
treecfb2217130cc63e2c71cd653fcd32692c60ec118 /sys
parent38b4c12eeccc78046378866d7b119d1ecffd19df (diff)
Fix a mbuf leak when reflecting an ICMP packet with IP options.
Free the options in icmp_input_if() after a successful call to icmp_reflect(). bug report and analysis by Hendrik Gerlach OK krw@ claudio@ phessler@
Diffstat (limited to 'sys')
-rw-r--r--sys/netinet/ip_icmp.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/netinet/ip_icmp.c b/sys/netinet/ip_icmp.c
index 051c9361901..8de565d1a35 100644
--- a/sys/netinet/ip_icmp.c
+++ b/sys/netinet/ip_icmp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ip_icmp.c,v 1.167 2017/05/04 17:58:46 bluhm Exp $ */
+/* $OpenBSD: ip_icmp.c,v 1.168 2017/05/22 14:26:08 bluhm Exp $ */
/* $NetBSD: ip_icmp.c,v 1.19 1996/02/13 23:42:22 christos Exp $ */
/*
@@ -591,8 +591,10 @@ reflect:
icmpstat_inc(icps_reflect);
icmpstat_inc(icps_outhist + icp->icmp_type);
- if (!icmp_reflect(m, &opts, NULL))
+ if (!icmp_reflect(m, &opts, NULL)) {
icmp_send(m, opts);
+ m_free(opts);
+ }
return IPPROTO_DONE;
case ICMP_REDIRECT: