1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-02 08:42:48 +00:00

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
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=355702

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