summaryrefslogtreecommitdiffstats
path: root/sbin
diff options
context:
space:
mode:
authorlulf <lulf@FreeBSD.org>2009-04-10 08:50:14 +0000
committerlulf <lulf@FreeBSD.org>2009-04-10 08:50:14 +0000
commit62687638dfa1347290a308e562153a2314cbd8fa (patch)
treedbef804cce038f6daa1d9598a974dc10f18afecf /sbin
parentfbd36468425151a258c7a90df46c0de1a069a137 (diff)
downloadFreeBSD-src-62687638dfa1347290a308e562153a2314cbd8fa.zip
FreeBSD-src-62687638dfa1347290a308e562153a2314cbd8fa.tar.gz
- Move out allocation part of different gvinum objects into its own routine and
make use of it in the gvinum userland code.
Diffstat (limited to 'sbin')
-rw-r--r--sbin/gvinum/gvinum.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/sbin/gvinum/gvinum.c b/sbin/gvinum/gvinum.c
index bea4f7c..b867fd4 100644
--- a/sbin/gvinum/gvinum.c
+++ b/sbin/gvinum/gvinum.c
@@ -433,10 +433,9 @@ create_drive(char *device)
req = gctl_get_handle();
gctl_ro_param(req, "class", -1, "VINUM");
gctl_ro_param(req, "verb", -1, "create");
- d = malloc(sizeof(struct gv_drive));
+ d = gv_alloc_drive();
if (d == NULL)
err(1, "unable to allocate for gv_drive object");
- memset(d, 0, sizeof(struct gv_drive));
strlcpy(d->name, drivename, sizeof(d->name));
strlcpy(d->device, device, sizeof(d->device));
OpenPOWER on IntegriCloud