mirror of
https://git.FreeBSD.org/src.git
synced 2025-02-01 17:00:36 +00:00
Fix the precious change to check the pointer returned by malloc().
Submitted by: luke <luke.tw@gmail.com> Pointy hat to: jhb
This commit is contained in:
parent
2351669e6d
commit
32960dd10a
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=292443
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user