Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 22 Sep 2013 23:47:56 +0000 (UTC)
From:      Dag-Erling Smørgrav <des@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r255805 - head/sys/kern
Message-ID:  <201309222347.r8MNluGE061788@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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 */
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201309222347.r8MNluGE061788>