diff options
author | phk <phk@FreeBSD.org> | 2003-05-02 08:13:03 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 2003-05-02 08:13:03 +0000 |
commit | d2b42c66200d30820a758cd0705dcdef3597e7c6 (patch) | |
tree | d1003ca813ddc3ba5daaf42660572f39c90a019c /sys/geom | |
parent | b961f940afb9c90dc1a6fcca97a00c606a03c36b (diff) | |
download | FreeBSD-src-d2b42c66200d30820a758cd0705dcdef3597e7c6.zip FreeBSD-src-d2b42c66200d30820a758cd0705dcdef3597e7c6.tar.gz |
Use g_slice_spoiled().
Free buffer from g_read_data().
Diffstat (limited to 'sys/geom')
-rw-r--r-- | sys/geom/geom_mbr.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/sys/geom/geom_mbr.c b/sys/geom/geom_mbr.c index 362e540..c0232a7 100644 --- a/sys/geom/geom_mbr.c +++ b/sys/geom/geom_mbr.c @@ -300,7 +300,7 @@ g_mbr_taste(struct g_class *mp, struct g_provider *pp, int insist) g_topology_lock(); g_access_rel(cp, -1, 0, 0); if (LIST_EMPTY(&gp->provider)) { - g_std_spoiled(cp); + g_slice_spoiled(cp); return (NULL); } return (gp); @@ -398,8 +398,10 @@ g_mbrext_taste(struct g_class *mp, struct g_provider *pp, int insist __unused) buf = g_read_data(cp, off, sectorsize, &error); if (buf == NULL || error != 0) break; - if (buf[0x1fe] != 0x55 && buf[0x1ff] != 0xaa) + if (buf[0x1fe] != 0x55 && buf[0x1ff] != 0xaa) { + g_free(buf); break; + } for (i = 0; i < NDOSPART; i++) dos_partition_dec( buf + DOSPARTOFF + @@ -440,7 +442,7 @@ g_mbrext_taste(struct g_class *mp, struct g_provider *pp, int insist __unused) g_topology_lock(); g_access_rel(cp, -1, 0, 0); if (LIST_EMPTY(&gp->provider)) { - g_std_spoiled(cp); + g_slice_spoiled(cp); return (NULL); } return (gp); |