Skip to content

Commit 2babd20

Browse files
nabijaczlewelibehlendorf
authored andcommitted
libzfs: zfs_asprintf(): don't return undefined pointer
Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ahelenia Ziemiańska <[email protected]> Closes #11993
1 parent 87b671f commit 2babd20

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/libzfs/libzfs_util.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -782,8 +782,10 @@ zfs_asprintf(libzfs_handle_t *hdl, const char *fmt, ...)
782782

783783
va_end(ap);
784784

785-
if (err < 0)
785+
if (err < 0) {
786786
(void) no_memory(hdl);
787+
ret = NULL;
788+
}
787789

788790
return (ret);
789791
}

0 commit comments

Comments
 (0)