Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 16 Mar 2017 15:10:05 +0000 (UTC)
From:      "Pedro F. Giffuni" <pfg@FreeBSD.org>
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
Message-ID:  <201703161510.v2GFA5P8093789@repo.freebsd.org>

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



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