Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 2 Jan 2017 15:17:33 +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: r311102 - head/lib/libc/net
Message-ID:  <201701021517.v02FHXOb048750@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: pfg
Date: Mon Jan  2 15:17:33 2017
New Revision: 311102
URL: https://svnweb.freebsd.org/changeset/base/311102

Log:
  Cleanup inelegant calloc(3) introduced in r310984.

Modified:
  head/lib/libc/net/getaddrinfo.c

Modified: head/lib/libc/net/getaddrinfo.c
==============================================================================
--- head/lib/libc/net/getaddrinfo.c	Mon Jan  2 15:12:11 2017	(r311101)
+++ head/lib/libc/net/getaddrinfo.c	Mon Jan  2 15:17:33 2017	(r311102)
@@ -691,7 +691,7 @@ reorder(struct addrinfo *sentinel)
 		return(n);
 
 	/* allocate a temporary array for sort and initialization of it. */
-	if ((aio = calloc(1, sizeof(*aio) * n)) == NULL)
+	if ((aio = calloc(n, sizeof(*aio))) == NULL)
 		return(n);	/* give up reordering */
 
 	/* retrieve address selection policy from the kernel */



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