Date: Mon, 13 Mar 2017 04:14:04 +0000 (UTC) From: "Pedro F. Giffuni" <pfg@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r315187 - head/lib/libc/stdlib Message-ID: <201703130414.v2D4E4KG035180@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
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;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201703130414.v2D4E4KG035180>