diff --git a/tools/regression/geom_gpt/gctl_test_helper.c b/tools/regression/geom_gpt/gctl_test_helper.c index 48440d037a9f..9e1d5fc5dbb8 100644 --- a/tools/regression/geom_gpt/gctl_test_helper.c +++ b/tools/regression/geom_gpt/gctl_test_helper.c @@ -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);