svn commit: r319169 - stable/11/tools/regression/geom_gpt

Ngie Cooper ngie at FreeBSD.org
Tue May 30 02:56:18 UTC 2017


Author: ngie
Date: Tue May 30 02:56:17 2017
New Revision: 319169
URL: https://svnweb.freebsd.org/changeset/base/319169

Log:
  MFC r319015:
  
  Use calloc instead of malloc + memset

Modified:
  stable/11/tools/regression/geom_gpt/gctl_test_helper.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/tools/regression/geom_gpt/gctl_test_helper.c
==============================================================================
--- stable/11/tools/regression/geom_gpt/gctl_test_helper.c	Tue May 30 02:53:00 2017	(r319168)
+++ stable/11/tools/regression/geom_gpt/gctl_test_helper.c	Tue May 30 02:56:17 2017	(r319169)
@@ -87,10 +87,9 @@ parse(char *arg, char **param, char **value, int *len)
 			return (EINVAL);
 		if (*len <= 0 || *len > PATH_MAX)
 			return (EINVAL);
-		*value = malloc(*len);
+		*value = calloc(*len, sizeof(char));
 		if (*value == NULL)
 			return (ENOMEM);
-		memset(*value, 0, *len);
 		if (equal != NULL) {
 			if (strlen(equal) >= PATH_MAX)
 				return (ENOMEM);


More information about the svn-src-all mailing list