svn commit: r292443 - head/usr.sbin/boot0cfg

John Baldwin jhb at FreeBSD.org
Fri Dec 18 17:52:10 UTC 2015


Author: jhb
Date: Fri Dec 18 17:52:08 2015
New Revision: 292443
URL: https://svnweb.freebsd.org/changeset/base/292443

Log:
  Fix the precious change to check the pointer returned by malloc().
  
  Submitted by:	luke <luke.tw at gmail.com>
  Pointy hat to:	jhb

Modified:
  head/usr.sbin/boot0cfg/boot0cfg.c

Modified: head/usr.sbin/boot0cfg/boot0cfg.c
==============================================================================
--- head/usr.sbin/boot0cfg/boot0cfg.c	Fri Dec 18 17:39:54 2015	(r292442)
+++ head/usr.sbin/boot0cfg/boot0cfg.c	Fri Dec 18 17:52:08 2015	(r292443)
@@ -337,7 +337,7 @@ read_mbr(const char *disk, u_int8_t **mb
 	return (mbr_size);
     }
     *mbr = malloc(sizeof(buf));
-    if (mbr == NULL)
+    if (*mbr == NULL)
 	errx(1, "%s: unable to allocate MBR buffer", disk);
     memcpy(*mbr, buf, sizeof(buf));
     close(fd);


More information about the svn-src-all mailing list