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
This commit is contained in:
parent
71c47d1480
commit
fc4c825847
@ -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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user