From 506bdc53a498a4d9361ba270a705e7ba4dde63da Mon Sep 17 00:00:00 2001 From: ngie <ngie@FreeBSD.org> Date: Sat, 27 May 2017 23:57:09 +0000 Subject: [PATCH] Use calloc instead of malloc + memset MFC after: 3 days Sponsored by: Dell EMC Isilon --- tools/regression/geom_gpt/gctl_test_helper.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) 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);