aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorнаб <[email protected]>2021-05-03 12:30:16 +0200
committerBrian Behlendorf <[email protected]>2021-05-08 09:37:40 -0700
commit2babd200454eff922ba2cae23a20db2308ec8059 (patch)
tree1a7d22cd7e604c452ea32cdbe3d9a67c8243968f /lib
parent87b671f3ace5ab47fd5449279374051cfd8856b4 (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
Diffstat (limited to 'lib')
-rw-r--r--lib/libzfs/libzfs_util.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/libzfs/libzfs_util.c b/lib/libzfs/libzfs_util.c
index 8038f7fa3..7840e3590 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);
}