summaryrefslogtreecommitdiffstats
path: root/sys/netinet6
diff options
context:
space:
mode:
authorrwatson <rwatson@FreeBSD.org>2006-01-14 00:09:41 +0000
committerrwatson <rwatson@FreeBSD.org>2006-01-14 00:09:41 +0000
commite4a63cbf9b72e789dfbe4424ceefab5c0be0211c (patch)
tree8d1aca944b0e972d147adeb214132f2a39a718dd /sys/netinet6
parent567602e49bc333f0ebb4bdbe1ba1858c36323246 (diff)
downloadFreeBSD-src-e4a63cbf9b72e789dfbe4424ceefab5c0be0211c.zip
FreeBSD-src-e4a63cbf9b72e789dfbe4424ceefab5c0be0211c.tar.gz
When storing the results of malloc() in a pointer to a pointer, check
the pointer to a pointer for NULL, not the pointer for NULL. Noticed by: Coverity Prevent analysis tool MFC after: 3 days
Diffstat (limited to 'sys/netinet6')
-rw-r--r--sys/netinet6/ip6_output.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/netinet6/ip6_output.c b/sys/netinet6/ip6_output.c
index b7f0cdd..4eb7a6e 100644
--- a/sys/netinet6/ip6_output.c
+++ b/sys/netinet6/ip6_output.c
@@ -3299,7 +3299,7 @@ ip6_setpktopt(optname, buf, len, opt, priv, sticky, cmsg, uproto)
/* turn off the previous option, then set the new option. */
ip6_clearpktopts(opt, optname);
*newdest = malloc(destlen, M_IP6OPT, M_NOWAIT);
- if (newdest == NULL)
+ if (*newdest == NULL)
return (ENOBUFS);
bcopy(dest, *newdest, destlen);
OpenPOWER on IntegriCloud