diff options
author | наб <[email protected]> | 2021-05-03 12:30:16 +0200 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2021-05-10 12:21:38 -0700 |
commit | 381a0ca1e8005cb4eb2be02e8e7c8454d91aff6c (patch) | |
tree | e7b006b9792a8d288bf288e7d937e466f3c62563 | |
parent | f7a69b93c64c8e88716e5b011d4ff743b56793c1 (diff) |
libzfs: zfs_asprintf(): don't return undefined pointer
Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Ahelenia Ziemiańska <[email protected]>
Closes #11993
-rw-r--r-- | lib/libzfs/libzfs_util.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/libzfs/libzfs_util.c b/lib/libzfs/libzfs_util.c index 01537b535..7a6e92692 100644 --- a/lib/libzfs/libzfs_util.c +++ b/lib/libzfs/libzfs_util.c @@ -782,8 +782,10 @@ zfs_asprintf(libzfs_handle_t *hdl, const char *fmt, ...) va_end(ap); - if (err < 0) + if (err < 0) { (void) no_memory(hdl); + ret = NULL; + } return (ret); } |