summaryrefslogtreecommitdiffstats
path: root/tools/regression
diff options
context:
space:
mode:
authorngie <ngie@FreeBSD.org>2017-05-30 02:56:17 +0000
committerngie <ngie@FreeBSD.org>2017-05-30 02:56:17 +0000
commit252dcfdd87a44cf31a539fdaaaf391f454166575 (patch)
treec03eb36082fa43e45ca919b10c44e30a90019f75 /tools/regression
parent50f3c914a6db48382e5338d68fa70b1f5ed8eef6 (diff)
downloadFreeBSD-src-252dcfdd87a44cf31a539fdaaaf391f454166575.zip
FreeBSD-src-252dcfdd87a44cf31a539fdaaaf391f454166575.tar.gz
MFC r319015:
Use calloc instead of malloc + memset
Diffstat (limited to 'tools/regression')
-rw-r--r--tools/regression/geom_gpt/gctl_test_helper.c3
1 files changed, 1 insertions, 2 deletions
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);
OpenPOWER on IntegriCloud