svn commit: r298180 - head/usr.sbin/makefs/ffs

Marcelo Araujo araujo at FreeBSD.org
Mon Apr 18 05:19:46 UTC 2016


Author: araujo
Date: Mon Apr 18 05:19:45 2016
New Revision: 298180
URL: https://svnweb.freebsd.org/changeset/base/298180

Log:
  The malloc will return NULL if it can't allocate memory.
  
  MFC after:	2 weeks.

Modified:
  head/usr.sbin/makefs/ffs/mkfs.c

Modified: head/usr.sbin/makefs/ffs/mkfs.c
==============================================================================
--- head/usr.sbin/makefs/ffs/mkfs.c	Mon Apr 18 04:43:50 2016	(r298179)
+++ head/usr.sbin/makefs/ffs/mkfs.c	Mon Apr 18 05:19:45 2016	(r298180)
@@ -492,7 +492,7 @@ ffs_mkfs(const char *fsys, const fsinfo_
 		iobufsize = SBLOCKSIZE + 3 * sblock.fs_bsize;
 	else
 		iobufsize = 4 * sblock.fs_bsize;
-	if ((iobuf = malloc(iobufsize)) == 0) {
+	if ((iobuf = malloc(iobufsize)) == NULL) {
 		printf("Cannot allocate I/O buffer\n");
 		exit(38);
 	}


More information about the svn-src-head mailing list