Commit 87b671f3 authored by наб's avatar наб Committed by Brian Behlendorf
Browse files

libzfsbootenv: lzbe_set_boot_device(): don't free undefined pointer


Reviewed-by: default avatarBrian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: default avatarAhelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #11993
parent c4939434
......@@ -88,12 +88,11 @@ lzbe_set_boot_device(const char *pool, lzbe_flags_t flag, const char *device)
if (strncmp(device, "zfs:", 4) == 0) {
fnvlist_add_string(nv, OS_BOOTONCE, device);
} else {
descriptor = NULL;
if (asprintf(&descriptor, "zfs:%s:", device) > 0)
if (asprintf(&descriptor, "zfs:%s:", device) > 0) {
fnvlist_add_string(nv, OS_BOOTONCE, descriptor);
else
free(descriptor);
} else
rv = ENOMEM;
free(descriptor);
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment