svn commit: r255805 - head/sys/kern
Dag-Erling Smørgrav
des at FreeBSD.org
Sun Sep 22 23:47:56 UTC 2013
Author: des
Date: Sun Sep 22 23:47:56 2013
New Revision: 255805
URL: http://svnweb.freebsd.org/changeset/base/255805
Log:
Always request zeroed memory, in case we're dumb enough to leak it later.
Approved by: re (gjb)
Modified:
head/sys/kern/subr_sbuf.c
Modified: head/sys/kern/subr_sbuf.c
==============================================================================
--- head/sys/kern/subr_sbuf.c Sun Sep 22 22:03:30 2013 (r255804)
+++ head/sys/kern/subr_sbuf.c Sun Sep 22 23:47:56 2013 (r255805)
@@ -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 */
More information about the svn-src-all
mailing list