From 32960dd10aa9c53ee43f8940637af0f4355642c7 Mon Sep 17 00:00:00 2001 From: John Baldwin Date: Fri, 18 Dec 2015 17:52:08 +0000 Subject: [PATCH] Fix the precious change to check the pointer returned by malloc(). Submitted by: luke Pointy hat to: jhb --- usr.sbin/boot0cfg/boot0cfg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.sbin/boot0cfg/boot0cfg.c b/usr.sbin/boot0cfg/boot0cfg.c index 20b615a218c..f2cbf67a39d 100644 --- a/usr.sbin/boot0cfg/boot0cfg.c +++ b/usr.sbin/boot0cfg/boot0cfg.c @@ -337,7 +337,7 @@ read_mbr(const char *disk, u_int8_t **mbr, int check_version) 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);