aboutsummaryrefslogtreecommitdiff
path: root/stand/libsa
diff options
context:
space:
mode:
authorToomas Soome <tsoome@FreeBSD.org>2019-11-03 13:03:47 +0000
committerToomas Soome <tsoome@FreeBSD.org>2019-11-03 13:03:47 +0000
commitf4ed0045735d88aa681b4933072ff35a890a86a0 (patch)
treeca211da22534ea04250b0dab9212afc5654aac83 /stand/libsa
parent83ba1468ab9d92804507ce44f31965f51252c9d4 (diff)
downloadsrc-f4ed0045735d88aa681b4933072ff35a890a86a0.tar.gz
src-f4ed0045735d88aa681b4933072ff35a890a86a0.zip
loader: should check malloc in zfs_dev_open
malloc can return NULL.
Notes
Notes: svn path=/head/; revision=354282
Diffstat (limited to 'stand/libsa')
-rw-r--r--stand/libsa/zfs/zfs.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/stand/libsa/zfs/zfs.c b/stand/libsa/zfs/zfs.c
index 6a8d523fb798..987ed4666ad3 100644
--- a/stand/libsa/zfs/zfs.c
+++ b/stand/libsa/zfs/zfs.c
@@ -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);