diff options
author | ngie <ngie@FreeBSD.org> | 2017-05-30 02:56:17 +0000 |
---|---|---|
committer | ngie <ngie@FreeBSD.org> | 2017-05-30 02:56:17 +0000 |
commit | 252dcfdd87a44cf31a539fdaaaf391f454166575 (patch) | |
tree | c03eb36082fa43e45ca919b10c44e30a90019f75 /tools/regression | |
parent | 50f3c914a6db48382e5338d68fa70b1f5ed8eef6 (diff) | |
download | FreeBSD-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.c | 3 |
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); |