From 252dcfdd87a44cf31a539fdaaaf391f454166575 Mon Sep 17 00:00:00 2001 From: ngie Date: Tue, 30 May 2017 02:56:17 +0000 Subject: MFC r319015: Use calloc instead of malloc + memset --- tools/regression/geom_gpt/gctl_test_helper.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'tools/regression') diff --git a/tools/regression/geom_gpt/gctl_test_helper.c b/tools/regression/geom_gpt/gctl_test_helper.c index 48440d0..9e1d5fc 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); -- cgit v1.1