summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorToomas Soome <tsoome@me.com>2019-12-12 17:32:49 +0200
committerToomas Soome <tsoome@me.com>2019-12-18 19:14:59 +0200
commitfdf04373777e703cebbbce0f774ae970eb6030f7 (patch)
treec05486476cc4c425af57e2da4db145d75d55cd15
parentcf01ae8a5d067a3ba8327d8bc6be298d84204a4d (diff)
downloadillumos-joyent-fdf04373777e703cebbbce0f774ae970eb6030f7.tar.gz
12072 loader: vdisk dereference after free
Reviewed by: Matthias Scheler <mscheler@tintri.com> Approved by: Dan McDonald <danmcd@joyent.com>
-rw-r--r--usr/src/boot/sys/boot/common/vdisk.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/usr/src/boot/sys/boot/common/vdisk.c b/usr/src/boot/sys/boot/common/vdisk.c
index baab877428..bb5b2eb6d1 100644
--- a/usr/src/boot/sys/boot/common/vdisk.c
+++ b/usr/src/boot/sys/boot/common/vdisk.c
@@ -228,10 +228,10 @@ command_unmapvd(int argc, char *argv[])
}
STAILQ_REMOVE(&vdisk_list, vd, vdisk_info, vdisk_link);
- close(vd->vdisk_fd);
+ (void) close(vd->vdisk_fd);
+ printf("%s (%s) unmapped\n", argv[1], vd->vdisk_path);
free(vd->vdisk_path);
free(vd);
- printf("%s (%s) unmapped\n", argv[1], vd->vdisk_path);
return (CMD_OK);
}