From owner-svn-src-stable@freebsd.org Thu Mar 16 15:10:06 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 30A59D0F01B; Thu, 16 Mar 2017 15:10:06 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F3CF7121C; Thu, 16 Mar 2017 15:10:05 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v2GFA5Zd093790; Thu, 16 Mar 2017 15:10:05 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2GFA5P8093789; Thu, 16 Mar 2017 15:10:05 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201703161510.v2GFA5P8093789@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Thu, 16 Mar 2017 15:10:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r315415 - stable/10/lib/libc/stdlib X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Mar 2017 15:10:06 -0000 Author: pfg Date: Thu Mar 16 15:10:04 2017 New Revision: 315415 URL: https://svnweb.freebsd.org/changeset/base/315415 Log: MFC r315187: libc: mall cleanup. Let calloc(3) do the multiplication. Modified: stable/10/lib/libc/stdlib/getenv.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/stdlib/getenv.c ============================================================================== --- stable/10/lib/libc/stdlib/getenv.c Thu Mar 16 15:03:53 2017 (r315414) +++ stable/10/lib/libc/stdlib/getenv.c Thu Mar 16 15:10:04 2017 (r315415) @@ -342,7 +342,7 @@ __build_env(void) envVarsSize = envVarsTotal * 2; /* Create new environment. */ - envVars = calloc(1, sizeof (*envVars) * envVarsSize); + envVars = calloc(envVarsSize, sizeof(*envVars)); if (envVars == NULL) goto Failure;