From 62687638dfa1347290a308e562153a2314cbd8fa Mon Sep 17 00:00:00 2001 From: lulf Date: Fri, 10 Apr 2009 08:50:14 +0000 Subject: - Move out allocation part of different gvinum objects into its own routine and make use of it in the gvinum userland code. --- sbin/gvinum/gvinum.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'sbin') 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)); -- cgit v1.1