diff options
author | bde <bde@FreeBSD.org> | 2000-01-28 11:51:08 +0000 |
---|---|---|
committer | bde <bde@FreeBSD.org> | 2000-01-28 11:51:08 +0000 |
commit | e79d76144bf11256c79d3b23a4f2e2d64507a0fd (patch) | |
tree | 9c01fca2c7613bac4fea70ee4e12af84717ab385 /sys | |
parent | 286cc6ca6a0ea659f02a079fe526bc98776547d6 (diff) | |
download | FreeBSD-src-e79d76144bf11256c79d3b23a4f2e2d64507a0fd.zip FreeBSD-src-e79d76144bf11256c79d3b23a4f2e2d64507a0fd.tar.gz |
Fixed a memory leak for slices with an (unsupported) bad sector table.
Broken in: rev.1.80.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/kern/subr_diskslice.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/kern/subr_diskslice.c b/sys/kern/subr_diskslice.c index fb39f3d..e42488e 100644 --- a/sys/kern/subr_diskslice.c +++ b/sys/kern/subr_diskslice.c @@ -758,15 +758,16 @@ dsopen(dev, mode, flags, sspp, lp) if (msg == NULL && lp1->d_secsize != ssp->dss_secsize) msg = "inconsistent sector size"; if (msg != NULL) { - free(lp1, M_DEVBUF); if (sp->ds_type == DOSPTYP_386BSD /* XXX */) log(LOG_WARNING, "%s: cannot find label (%s)\n", sname, msg); + free(lp1, M_DEVBUF); continue; } if (lp1->d_flags & D_BADSECT) { log(LOG_ERR, "%s: bad sector table not supported\n", sname); + free(lp1, M_DEVBUF); continue; } set_ds_label(ssp, slice, lp1); |