From owner-p4-projects@FreeBSD.ORG Fri Oct 7 22:19:43 2011 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id ACB371065673; Fri, 7 Oct 2011 22:19:43 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6F52C106564A for ; Fri, 7 Oct 2011 22:19:43 +0000 (UTC) (envelope-from pjd@freebsd.org) Received: from skunkworks.freebsd.org (skunkworks.freebsd.org [IPv6:2001:4f8:fff6::2d]) by mx1.freebsd.org (Postfix) with ESMTP id 5DC708FC13 for ; Fri, 7 Oct 2011 22:19:43 +0000 (UTC) Received: from skunkworks.freebsd.org (localhost [127.0.0.1]) by skunkworks.freebsd.org (8.14.4/8.14.4) with ESMTP id p97MJhvP000219 for ; Fri, 7 Oct 2011 22:19:43 GMT (envelope-from pjd@freebsd.org) Received: (from perforce@localhost) by skunkworks.freebsd.org (8.14.4/8.14.4/Submit) id p97MJhV7000216 for perforce@freebsd.org; Fri, 7 Oct 2011 22:19:43 GMT (envelope-from pjd@freebsd.org) Date: Fri, 7 Oct 2011 22:19:43 GMT Message-Id: <201110072219.p97MJhV7000216@skunkworks.freebsd.org> X-Authentication-Warning: skunkworks.freebsd.org: perforce set sender to pjd@freebsd.org using -f From: Pawel Jakub Dawidek To: Perforce Change Reviews Precedence: bulk Cc: Subject: PERFORCE change 199877 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Oct 2011 22:19:44 -0000 http://p4web.freebsd.org/@@199877?ac=10 Change 199877 by pjd@pjd_anger on 2011/10/07 22:19:14 Prefer calloc() over malloc()+memset(ptr, 0, size). Affected files ... .. //depot/projects/trustedbsd/openbsm/libbsm/bsm_io.c#69 edit Differences ... ==== //depot/projects/trustedbsd/openbsm/libbsm/bsm_io.c#69 (text+ko) ==== @@ -32,7 +32,7 @@ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - * $P4: //depot/projects/trustedbsd/openbsm/libbsm/bsm_io.c#68 $ + * $P4: //depot/projects/trustedbsd/openbsm/libbsm/bsm_io.c#69 $ */ #include @@ -4485,11 +4485,10 @@ return (-1); } - *buf = malloc(recsize * sizeof(u_char)); + *buf = calloc(recsize, sizeof(u_char)); if (*buf == NULL) return (-1); bptr = *buf; - memset(bptr, 0, recsize); /* store the token contents already read, back to the buffer*/ *bptr = type;