svn commit: r355702 - head/stand/common

Toomas Soome tsoome at FreeBSD.org
Fri Dec 13 08:20:21 UTC 2019


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


More information about the svn-src-all mailing list