Author: tsoome
Date: Fri Dec 13 08:20:20 2019
New Revision: 355702
URL: https://svnweb.freebsd.org/changeset/base/355702
Log:
loader: vdisk dereference after free
print out the information and then free the memory used.
MFC after: 1 week
Modified:
head/stand/common/vdisk.c
Modified: head/stand/common/vdisk.c
==============================================================================
--- head/stand/common/vdisk.c Fri Dec 13 06:54:41 2019 (r355701)
+++ head/stand/common/vdisk.c Fri Dec 13 08:20:20 2019 (r355702)
@@ -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);
}
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "[email protected]"