summaryrefslogtreecommitdiffstats
path: root/sys/netinet6
diff options
context:
space:
mode:
authormtm <mtm@FreeBSD.org>2007-11-21 16:01:42 +0000
committermtm <mtm@FreeBSD.org>2007-11-21 16:01:42 +0000
commit46c3db4ab11e691b20ee497fb8b26b5f4d48fb16 (patch)
tree370b3bc6645a09d6e5d15f184f5b7b31e6aa4de4 /sys/netinet6
parente7409e54d4d1a91b409d9fe25dde641829a9f48a (diff)
downloadFreeBSD-src-46c3db4ab11e691b20ee497fb8b26b5f4d48fb16.zip
FreeBSD-src-46c3db4ab11e691b20ee497fb8b26b5f4d48fb16.tar.gz
Instead of manually freeing the packet options structure (and not even doing
a good job of it) in the copypktopts() function, just call ip6_clearpktopts() directly. Otherwise, the callers of this function would end up freeing the memory twice. Reviewed by: jinmei PR: kern/116360
Diffstat (limited to 'sys/netinet6')
-rw-r--r--sys/netinet6/ip6_output.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/sys/netinet6/ip6_output.c b/sys/netinet6/ip6_output.c
index e1a721a..74cd41f 100644
--- a/sys/netinet6/ip6_output.c
+++ b/sys/netinet6/ip6_output.c
@@ -2361,12 +2361,7 @@ copypktopts(struct ip6_pktopts *dst, struct ip6_pktopts *src, int canwait)
return (0);
bad:
- if (dst->ip6po_pktinfo) free(dst->ip6po_pktinfo, M_IP6OPT);
- if (dst->ip6po_nexthop) free(dst->ip6po_nexthop, M_IP6OPT);
- if (dst->ip6po_hbh) free(dst->ip6po_hbh, M_IP6OPT);
- if (dst->ip6po_dest1) free(dst->ip6po_dest1, M_IP6OPT);
- if (dst->ip6po_dest2) free(dst->ip6po_dest2, M_IP6OPT);
- if (dst->ip6po_rthdr) free(dst->ip6po_rthdr, M_IP6OPT);
+ ip6_clearpktopts(dst, -1);
return (ENOBUFS);
}
#undef PKTOPT_EXTHDRCPY
OpenPOWER on IntegriCloud