From 73dcfb8ddc0645d6b92d980fbdf083bfae040cf7 Mon Sep 17 00:00:00 2001 From: Enji Cooper 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 48440d037a9..9e1d5fc5dbb 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);