svn commit: r315214 - head/usr.sbin/mpsutil

Pedro F. Giffuni pfg at FreeBSD.org
Mon Mar 13 20:49:32 UTC 2017


Author: pfg
Date: Mon Mar 13 20:49:31 2017
New Revision: 315214
URL: https://svnweb.freebsd.org/changeset/base/315214

Log:
  mpsutil(8): let calloc(3) do the multiplying.

Modified:
  head/usr.sbin/mpsutil/mps_cmd.c

Modified: head/usr.sbin/mpsutil/mps_cmd.c
==============================================================================
--- head/usr.sbin/mpsutil/mps_cmd.c	Mon Mar 13 20:34:53 2017	(r315213)
+++ head/usr.sbin/mpsutil/mps_cmd.c	Mon Mar 13 20:49:31 2017	(r315214)
@@ -486,7 +486,7 @@ mps_firmware_get(int fd, unsigned char *
 	}
 
 	size = reply.ActualImageSize;
-	*firmware = calloc(1, sizeof(unsigned char) * size);
+	*firmware = calloc(size, sizeof(unsigned char));
 	if (*firmware == NULL) {
 		warn("calloc");
 		return (-1);


More information about the svn-src-all mailing list