1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-13 10:02:38 +00:00

loader: should check malloc in zfs_dev_open

malloc can return NULL.
This commit is contained in:
Toomas Soome 2019-11-03 13:03:47 +00:00
parent 83ba1468ab
commit f4ed004573
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=354282

View File

@ -669,6 +669,8 @@ zfs_dev_open(struct open_file *f, ...)
if (!spa)
return (ENXIO);
mount = malloc(sizeof(*mount));
if (mount == NULL)
return (ENOMEM);
rv = zfs_mount(spa, dev->root_guid, mount);
if (rv != 0) {
free(mount);