svn commit: r315187 - head/lib/libc/stdlib
Pedro F. Giffuni
pfg at FreeBSD.org
Mon Mar 13 04:14:05 UTC 2017
Author: pfg
Date: Mon Mar 13 04:14:03 2017
New Revision: 315187
URL: https://svnweb.freebsd.org/changeset/base/315187
Log:
Minor libc cleanup: let calloc(3) do the multiplication.
MFC after: 3 days
Modified:
head/lib/libc/stdlib/getenv.c
Modified: head/lib/libc/stdlib/getenv.c
==============================================================================
--- head/lib/libc/stdlib/getenv.c Mon Mar 13 02:12:33 2017 (r315186)
+++ head/lib/libc/stdlib/getenv.c Mon Mar 13 04:14:03 2017 (r315187)
@@ -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-head
mailing list