From owner-svn-src-all@FreeBSD.ORG Sun Sep 22 23:47:56 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 9EBAFA82; Sun, 22 Sep 2013 23:47:56 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8BAF4201C; Sun, 22 Sep 2013 23:47:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8MNlu6C061789; Sun, 22 Sep 2013 23:47:56 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r8MNluGE061788; Sun, 22 Sep 2013 23:47:56 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201309222347.r8MNluGE061788@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Sun, 22 Sep 2013 23:47:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r255805 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Sep 2013 23:47:56 -0000 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 */