Always request zeroed memory, in case we're dumb enough to leak it later.
Approved by: re (gjb)
This commit is contained in:
parent
462fc0e072
commit
0f7bc112c0
@ -52,11 +52,11 @@ __FBSDID("$FreeBSD$");
|
||||
|
||||
#ifdef _KERNEL
|
||||
static MALLOC_DEFINE(M_SBUF, "sbuf", "string buffers");
|
||||
#define SBMALLOC(size) malloc(size, M_SBUF, M_WAITOK)
|
||||
#define SBMALLOC(size) malloc(size, M_SBUF, M_WAITOK|M_ZERO)
|
||||
#define SBFREE(buf) free(buf, M_SBUF)
|
||||
#else /* _KERNEL */
|
||||
#define KASSERT(e, m)
|
||||
#define SBMALLOC(size) malloc(size)
|
||||
#define SBMALLOC(size) calloc(1, size)
|
||||
#define SBFREE(buf) free(buf)
|
||||
#endif /* _KERNEL */
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user