malloc: avoid possibly returning stack garbage if MALLOC_DEBUG is defined
This commit is contained in:
parent
96915338d5
commit
366f674ab5
@ -559,6 +559,7 @@ malloc(size_t size, struct malloc_type *mtp, int flags)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef MALLOC_DEBUG
|
#ifdef MALLOC_DEBUG
|
||||||
|
va = NULL;
|
||||||
if (malloc_dbg(&va, &size, mtp, flags) != 0)
|
if (malloc_dbg(&va, &size, mtp, flags) != 0)
|
||||||
return (va);
|
return (va);
|
||||||
#endif
|
#endif
|
||||||
@ -604,6 +605,7 @@ malloc_domain(size_t size, struct malloc_type *mtp, int domain,
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef MALLOC_DEBUG
|
#ifdef MALLOC_DEBUG
|
||||||
|
va = NULL;
|
||||||
if (malloc_dbg(&va, &size, mtp, flags) != 0)
|
if (malloc_dbg(&va, &size, mtp, flags) != 0)
|
||||||
return (va);
|
return (va);
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user