libzfs: zfs_asprintf(): don't return undefined pointer

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #11993
This commit is contained in:
наб 2021-05-03 12:30:16 +02:00 committed by Brian Behlendorf
parent 87b671f3ac
commit 2babd20045
1 changed files with 3 additions and 1 deletions

View File

@ -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);
}