malloc: avoid possibly returning stack garbage if MALLOC_DEBUG is defined

This commit is contained in:
mmacy 2018-05-19 04:43:49 +00:00
parent 96915338d5
commit 366f674ab5

View File

@ -559,6 +559,7 @@ malloc(size_t size, struct malloc_type *mtp, int flags)
#endif
#ifdef MALLOC_DEBUG
va = NULL;
if (malloc_dbg(&va, &size, mtp, flags) != 0)
return (va);
#endif
@ -604,6 +605,7 @@ malloc_domain(size_t size, struct malloc_type *mtp, int domain,
#endif
#ifdef MALLOC_DEBUG
va = NULL;
if (malloc_dbg(&va, &size, mtp, flags) != 0)
return (va);
#endif