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;
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to