summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
Diffstat (limited to 'sys')
-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 e1a721a84083..74cd41f0afcc 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