svn commit: r311102 - head/lib/libc/net

Pedro F. Giffuni pfg at FreeBSD.org
Mon Jan 2 15:17:34 UTC 2017


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 */


More information about the svn-src-head mailing list