Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 18 Apr 2016 05:19:45 +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: r298180 - head/usr.sbin/makefs/ffs
Message-ID:  <201604180519.u3I5JjPr018287@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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);
 	}



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201604180519.u3I5JjPr018287>