Page MenuHomeFreeBSD

D39414.diff
No OneTemporary

D39414.diff

diff --git a/stand/userboot/userboot/main.c b/stand/userboot/userboot/main.c
--- a/stand/userboot/userboot/main.c
+++ b/stand/userboot/userboot/main.c
@@ -235,7 +235,6 @@
struct devdesc *dd;
#if defined(USERBOOT_ZFS_SUPPORT)
struct zfs_devdesc zdev;
- char *buf = NULL;
if (userboot_zfs_found) {
@@ -272,17 +271,14 @@
#if defined(USERBOOT_ZFS_SUPPORT)
if (userboot_zfs_found) {
- buf = malloc(VDEV_PAD_SIZE);
- if (buf != NULL) {
- if (zfs_get_bootonce(&zdev, OS_BOOTONCE, buf,
- VDEV_PAD_SIZE) == 0) {
- printf("zfs bootonce: %s\n", buf);
- set_currdev(buf);
- setenv("zfs-bootonce", buf, 1);
- }
- free(buf);
- (void) zfs_attach_nvstore(&zdev);
+ char buf[VDEV_PAD_SIZE];
+
+ if (zfs_get_bootonce(&zdev, OS_BOOTONCE, buf, sizeof(buf)) == 0) {
+ printf("zfs bootonce: %s\n", buf);
+ set_currdev(buf);
+ setenv("zfs-bootonce", buf, 1);
}
+ (void)zfs_attach_nvstore(&zdev);
}
#endif
}

File Metadata

Mime Type
text/plain
Expires
Sun, Feb 15, 2:55 PM (6 h, 18 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
28745330
Default Alt Text
D39414.diff (943 B)

Event Timeline