Always request zeroed memory, in case we're dumb enough to leak it later.

Approved by:	re (gjb)
This commit is contained in:
Dag-Erling Smørgrav 2013-09-22 23:47:56 +00:00
parent 462fc0e072
commit 0f7bc112c0

View File

@ -52,11 +52,11 @@ __FBSDID("$FreeBSD$");
#ifdef _KERNEL #ifdef _KERNEL
static MALLOC_DEFINE(M_SBUF, "sbuf", "string buffers"); 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) #define SBFREE(buf) free(buf, M_SBUF)
#else /* _KERNEL */ #else /* _KERNEL */
#define KASSERT(e, m) #define KASSERT(e, m)
#define SBMALLOC(size) malloc(size) #define SBMALLOC(size) calloc(1, size)
#define SBFREE(buf) free(buf) #define SBFREE(buf) free(buf)
#endif /* _KERNEL */ #endif /* _KERNEL */