loader: vdisk dereference after free

print out the information and then free the memory used.

MFC after:	1 week
This commit is contained in:
Toomas Soome 2019-12-13 08:20:20 +00:00
parent 15da83398e
commit 68031519c9

View File

@ -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);
}