svn commit: r315415 - stable/10/lib/libc/stdlib

Pedro F. Giffuni pfg at FreeBSD.org
Thu Mar 16 15:10:06 UTC 2017


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;
 


More information about the svn-src-all mailing list