summaryrefslogtreecommitdiff
path: root/sys/netinet6
diff options
context:
space:
mode:
authorCharles Longeau <chl@cvs.openbsd.org>2011-05-02 22:17:29 +0000
committerCharles Longeau <chl@cvs.openbsd.org>2011-05-02 22:17:29 +0000
commit24d0809b8adafe3f7897deccdf0a697c52fac496 (patch)
treee7722b683333410355fed170300da6a56da266d6 /sys/netinet6
parent337d225e2e17f37434932257ab533d685decf0fc (diff)
Fix potential null dereference.
Found by LLVM/Clang Static Analyzer. ok henning@ claudio@ krw@
Diffstat (limited to 'sys/netinet6')
-rw-r--r--sys/netinet6/ip6_output.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/netinet6/ip6_output.c b/sys/netinet6/ip6_output.c
index 29789f85136..03ff8f21290 100644
--- a/sys/netinet6/ip6_output.c
+++ b/sys/netinet6/ip6_output.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ip6_output.c,v 1.120 2011/04/05 11:48:28 blambert Exp $ */
+/* $OpenBSD: ip6_output.c,v 1.121 2011/05/02 22:17:28 chl Exp $ */
/* $KAME: ip6_output.c,v 1.172 2001/03/25 09:55:56 itojun Exp $ */
/*
@@ -2299,14 +2299,14 @@ copypktopts(struct ip6_pktopts *dst, struct ip6_pktopts *src, int canwait)
if (src->ip6po_pktinfo) {
dst->ip6po_pktinfo = malloc(sizeof(*dst->ip6po_pktinfo),
M_IP6OPT, canwait);
- if (dst->ip6po_pktinfo == NULL && canwait == M_NOWAIT)
+ if (dst->ip6po_pktinfo == NULL)
goto bad;
*dst->ip6po_pktinfo = *src->ip6po_pktinfo;
}
if (src->ip6po_nexthop) {
dst->ip6po_nexthop = malloc(src->ip6po_nexthop->sa_len,
M_IP6OPT, canwait);
- if (dst->ip6po_nexthop == NULL && canwait == M_NOWAIT)
+ if (dst->ip6po_nexthop == NULL)
goto bad;
bcopy(src->ip6po_nexthop, dst->ip6po_nexthop,
src->ip6po_nexthop->sa_len);