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);