Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 13 Mar 2017 20:49:31 +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: r315214 - head/usr.sbin/mpsutil
Message-ID:  <201703132049.v2DKnVvm042064@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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);



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