svn commit: r355929 - stable/12/stand/common

Toomas Soome tsoome at FreeBSD.org
Fri Dec 20 08:15:56 UTC 2019


Author: tsoome
Date: Fri Dec 20 08:15:55 2019
New Revision: 355929
URL: https://svnweb.freebsd.org/changeset/base/355929

Log:
  MFC r355702:
  loader: vdisk dereference after free
  
  print out the information and then free the memory used.

Modified:
  stable/12/stand/common/vdisk.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/stand/common/vdisk.c
==============================================================================
--- stable/12/stand/common/vdisk.c	Fri Dec 20 08:12:44 2019	(r355928)
+++ stable/12/stand/common/vdisk.c	Fri Dec 20 08:15:55 2019	(r355929)
@@ -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