From 65c545bff143fb7ebecbf312e0f289f8604f770a Mon Sep 17 00:00:00 2001 From: des Date: Sun, 22 Sep 2013 23:47:56 +0000 Subject: [PATCH] Always request zeroed memory, in case we're dumb enough to leak it later. Approved by: re (gjb) --- sys/kern/subr_sbuf.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/kern/subr_sbuf.c b/sys/kern/subr_sbuf.c index 68a7b156cb34..1490bc6ebd44 100644 --- a/sys/kern/subr_sbuf.c +++ b/sys/kern/subr_sbuf.c @@ -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 */