The branch stable/12 has been updated by kevans:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=16608adccae5bac11367c71a964d374631ef6a5f

commit 16608adccae5bac11367c71a964d374631ef6a5f
Author:     Toomas Soome <[email protected]>
AuthorDate: 2019-11-03 13:03:47 +0000
Commit:     Kyle Evans <[email protected]>
CommitDate: 2021-10-08 01:15:58 +0000

    loader: should check malloc in zfs_dev_open
    
    malloc can return NULL.
    
    (cherry picked from commit f4ed0045735d88aa681b4933072ff35a890a86a0)
---
 stand/libsa/zfs/zfs.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/stand/libsa/zfs/zfs.c b/stand/libsa/zfs/zfs.c
index 3393bcc45052..9386dd7b3729 100644
--- a/stand/libsa/zfs/zfs.c
+++ b/stand/libsa/zfs/zfs.c
@@ -683,6 +683,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);

Reply via email to