phkmalloc strikes again! :-) Another use of un-cleared returns from

malloc squashed...
This commit is contained in:
Peter Wemm 1995-12-09 04:45:50 +00:00
parent 77721f53be
commit a52219bb33
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=12683

View File

@ -157,6 +157,7 @@ _kvm_malloc(kd, n)
if ((p = malloc(n)) == NULL)
_kvm_err(kd, kd->program, strerror(errno));
memset(p, 0, n);
return (p);
}
@ -275,6 +276,7 @@ kvm_openfiles(uf, mf, sf, flag, errout)
(void)strcpy(errout, strerror(errno));
return (0);
}
memset(kd, 0, sizeof(*kd));
kd->program = 0;
return (_kvm_open(kd, uf, mf, sf, flag, errout));
}
@ -295,6 +297,7 @@ kvm_open(uf, mf, sf, flag, errstr)
errstr, strerror(errno));
return (0);
}
memset(kd, 0, sizeof(*kd));
kd->program = errstr;
return (_kvm_open(kd, uf, mf, sf, flag, NULL));
}