Use NULL instead of 0 for pointers.
malloc will return NULL if it cannot allocate memory. MFC after: 2 weeks.
This commit is contained in:
parent
f60708c9f7
commit
028d447b59
@ -863,7 +863,7 @@ main(int argc, char *argv[])
|
||||
|
||||
/* set IP6 packet options */
|
||||
if (ip6optlen) {
|
||||
if ((scmsg = (char *)malloc(ip6optlen)) == 0)
|
||||
if ((scmsg = (char *)malloc(ip6optlen)) == NULL)
|
||||
errx(1, "can't allocate enough memory");
|
||||
smsghdr.msg_control = (caddr_t)scmsg;
|
||||
smsghdr.msg_controllen = ip6optlen;
|
||||
|
Loading…
Reference in New Issue
Block a user