svn commit: r298238 - head/sbin/ping6
Marcelo Araujo
araujo at FreeBSD.org
Tue Apr 19 01:57:58 UTC 2016
Author: araujo
Date: Tue Apr 19 01:57:56 2016
New Revision: 298238
URL: https://svnweb.freebsd.org/changeset/base/298238
Log:
Use NULL instead of 0 for pointers.
malloc will return NULL if it cannot allocate memory.
MFC after: 2 weeks.
Modified:
head/sbin/ping6/ping6.c
Modified: head/sbin/ping6/ping6.c
==============================================================================
--- head/sbin/ping6/ping6.c Tue Apr 19 01:48:18 2016 (r298237)
+++ head/sbin/ping6/ping6.c Tue Apr 19 01:57:56 2016 (r298238)
@@ -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;
More information about the svn-src-head
mailing list