summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorchl <chl@openbsd.org>2011-05-02 22:17:28 +0000
committerchl <chl@openbsd.org>2011-05-02 22:17:28 +0000
commit12986e1ecf95f8f80146ba8c1961e836bf5b434d (patch)
treeea410e34178f24e31825700106f4ee4e2a940ce8 /sys
parentFix potential null dereference. (diff)
downloadwireguard-openbsd-12986e1ecf95f8f80146ba8c1961e836bf5b434d.tar.xz
wireguard-openbsd-12986e1ecf95f8f80146ba8c1961e836bf5b434d.zip
Fix potential null dereference.
Found by LLVM/Clang Static Analyzer. ok henning@ claudio@ krw@
Diffstat (limited to 'sys')
-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);