Zero memory after malloc. This stops sysinstall from dumping core

during disk probing with malloc debugging enabled.

MFC after:	1 week
This commit is contained in:
Kris Kennaway 2002-10-12 22:01:57 +00:00
parent c4222cfe76
commit 5060afe8bc
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=105005

View File

@ -515,6 +515,7 @@ Disk_Names()
error = sysctlbyname("kern.disks", NULL, &listsize, NULL, 0);
if (!error) {
disklist = (char *)malloc(listsize);
memset(disklist, 0, listsize);
error = sysctlbyname("kern.disks", disklist, &listsize, NULL, 0);
if (error)
return NULL;