summaryrefslogtreecommitdiffstats
path: root/sys/geom/label
diff options
context:
space:
mode:
authorpjd <pjd@FreeBSD.org>2004-07-06 16:29:32 +0000
committerpjd <pjd@FreeBSD.org>2004-07-06 16:29:32 +0000
commit67f23990b6f1f28b43ade386d13dcfe738ccd3a1 (patch)
treec40af861cba973e0ce811b91fc667b2b645e3a80 /sys/geom/label
parentad00499f5b7891938cda91d0933382dbeee9a24a (diff)
downloadFreeBSD-src-67f23990b6f1f28b43ade386d13dcfe738ccd3a1.zip
FreeBSD-src-67f23990b6f1f28b43ade386d13dcfe738ccd3a1.tar.gz
Properly free resources if g_access() fails.
Diffstat (limited to 'sys/geom/label')
-rw-r--r--sys/geom/label/g_label.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/geom/label/g_label.c b/sys/geom/label/g_label.c
index 7b0781b..095e5cd 100644
--- a/sys/geom/label/g_label.c
+++ b/sys/geom/label/g_label.c
@@ -210,8 +210,10 @@ g_label_taste(struct g_class *mp, struct g_provider *pp, int flags __unused)
cp = g_new_consumer(gp);
g_attach(cp, pp);
error = g_access(cp, 1, 0, 0);
- if (error != 0)
+ if (error != 0) {
+ g_wither_geom(gp);
return (NULL);
+ }
do {
error = g_label_read_metadata(cp, &md);
OpenPOWER on IntegriCloud