Skip to content

Commit

Permalink
libzfs: zfs_asprintf(): don't return undefined pointer
Browse files Browse the repository at this point in the history
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #11993
  • Loading branch information
nabijaczleweli authored and behlendorf committed May 8, 2021
1 parent 87b671f commit 2babd20
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/libzfs/libzfs_util.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 2babd20

Please sign in to comment.