diff options
author | jhb <jhb@FreeBSD.org> | 2015-12-18 17:52:08 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2015-12-18 17:52:08 +0000 |
commit | 4a57c82f71d4dc58cefcceb5b41b611808ea0a65 (patch) | |
tree | bf767bb610a88aea6e6b1940e80a609d8f24fe66 /usr.sbin | |
parent | bd6c2ef4d98b59d8b7bd987621bd8c291d57b529 (diff) | |
download | FreeBSD-src-4a57c82f71d4dc58cefcceb5b41b611808ea0a65.zip FreeBSD-src-4a57c82f71d4dc58cefcceb5b41b611808ea0a65.tar.gz |
Fix the precious change to check the pointer returned by malloc().
Submitted by: luke <luke.tw@gmail.com>
Pointy hat to: jhb
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/boot0cfg/boot0cfg.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/usr.sbin/boot0cfg/boot0cfg.c b/usr.sbin/boot0cfg/boot0cfg.c index 20b615a..f2cbf67 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); |