diff options
author | pjd <pjd@FreeBSD.org> | 2004-07-06 16:29:32 +0000 |
---|---|---|
committer | pjd <pjd@FreeBSD.org> | 2004-07-06 16:29:32 +0000 |
commit | 67f23990b6f1f28b43ade386d13dcfe738ccd3a1 (patch) | |
tree | c40af861cba973e0ce811b91fc667b2b645e3a80 /sys/geom/label | |
parent | ad00499f5b7891938cda91d0933382dbeee9a24a (diff) | |
download | FreeBSD-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.c | 4 |
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); |