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...@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); _______________________________________________ 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"