Author: ngie
Date: Sat May 27 23:57:09 2017
New Revision: 319015
URL: https://svnweb.freebsd.org/changeset/base/319015
Log:
Use calloc instead of malloc + memset
MFC after: 3 days
Sponsored by: Dell EMC Isilon
Modified:
head/tools/regression/geom_gpt/gctl_test_helper.c
Modified: head/tools/regression/geom_gpt/gctl_test_helper.c
==============================================================================
--- head/tools/regression/geom_gpt/gctl_test_helper.c Sat May 27 23:31:59
2017 (r319014)
+++ head/tools/regression/geom_gpt/gctl_test_helper.c Sat May 27 23:57:09
2017 (r319015)
@@ -87,10 +87,9 @@ parse(char *arg, char **param, char **va
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);
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "[email protected]"