summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorCan Erkin Acar <canacar@cvs.openbsd.org>2008-07-30 15:07:41 +0000
committerCan Erkin Acar <canacar@cvs.openbsd.org>2008-07-30 15:07:41 +0000
commite6d8613a2fdfecae83f942ea0fa2622d8ac5e096 (patch)
tree9598f2025c328c7e4ec88e79b1474c16ef15cd93 /sys
parentf04e7543a5acdb644631c0bd76be9d98bc73ea0b (diff)
Call ip6_clearpktopts() on error in copypktopts() instead of freeing
every field individually. ok claudio@ markus@ henning@ deraadt@
Diffstat (limited to 'sys')
-rw-r--r--sys/netinet6/ip6_output.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/sys/netinet6/ip6_output.c b/sys/netinet6/ip6_output.c
index 93d6cd418cb..1442e76ecc7 100644
--- a/sys/netinet6/ip6_output.c
+++ b/sys/netinet6/ip6_output.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ip6_output.c,v 1.102 2008/06/11 19:00:50 mcbride Exp $ */
+/* $OpenBSD: ip6_output.c,v 1.103 2008/07/30 15:07:40 canacar Exp $ */
/* $KAME: ip6_output.c,v 1.172 2001/03/25 09:55:56 itojun Exp $ */
/*
@@ -2253,13 +2253,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