Date: Tue, 19 Apr 2016 01:57:56 +0000 (UTC) From: Marcelo Araujo <araujo@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298238 - head/sbin/ping6 Message-ID: <201604190157.u3J1vuwE099007@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
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;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201604190157.u3J1vuwE099007>