Author: ngie
Date: Tue May 30 02:56:37 2017
New Revision: 319170
URL: https://svnweb.freebsd.org/changeset/base/319170
Log:
MFC r319015:
Use calloc instead of malloc + memset
Modified:
stable/10/tools/regression/geom_gpt/gctl_test_helper.c
Directory Properties:
stable/10/ (props changed)
Modified: stable/10/tools/regression/geom_gpt/gctl_test_helper.c
==============================================================================
--- stable/10/tools/regression/geom_gpt/gctl_test_helper.c Tue May 30
02:56:17 2017 (r319169)
+++ stable/10/tools/regression/geom_gpt/gctl_test_helper.c Tue May 30
02:56:37 2017 (r319170)
@@ -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);
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-stable-10
To unsubscribe, send any mail to "[email protected]"