Don't pass NULL pointer to memset if we are compiled with DIAGNOSTIC
Approved by: re/rwatson
This commit is contained in:
parent
3d5371a1a6
commit
1282e9acea
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=114935
@ -250,13 +250,12 @@ malloc(size, type, flags)
|
||||
ksp->ks_maxused = ksp->ks_memuse;
|
||||
|
||||
mtx_unlock(&ksp->ks_mtx);
|
||||
if (!(flags & M_NOWAIT))
|
||||
if (flags & M_WAITOK)
|
||||
KASSERT(va != NULL, ("malloc(M_WAITOK) returned NULL"));
|
||||
if (va == NULL) {
|
||||
else if (va == NULL)
|
||||
t_malloc_fail = time_uptime;
|
||||
}
|
||||
#ifdef DIAGNOSTIC
|
||||
if (!(flags & M_ZERO)) {
|
||||
if (va != NULL && !(flags & M_ZERO)) {
|
||||
memset(va, 0x70, osize);
|
||||
}
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user