From 68031519c95ce7db655b15c14ab37e33aae7524f Mon Sep 17 00:00:00 2001 From: Toomas Soome Date: Fri, 13 Dec 2019 08:20:20 +0000 Subject: [PATCH] loader: vdisk dereference after free print out the information and then free the memory used. MFC after: 1 week --- stand/common/vdisk.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/stand/common/vdisk.c b/stand/common/vdisk.c index f6120e260de1..521ad498b194 100644 --- a/stand/common/vdisk.c +++ b/stand/common/vdisk.c @@ -229,10 +229,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); }