g_uncompress_taste: prevent a double free.

Found by:	Clang Static Analyzer
MFC after:	1 week
This commit is contained in:
pfg 2015-04-20 16:31:27 +00:00
parent 2906a9e028
commit a9137e11b6

View File

@ -571,6 +571,7 @@ g_uncompress_taste(struct g_class *mp, struct g_provider *pp, int flags)
(buf+sizeof(struct cloop_header)))[i]);
}
free(buf, M_GEOM);
buf = NULL;
DPRINTF(("%s: done reading offsets\n", gp->name));
mtx_init(&sc->last_mtx, "geom_uncompress cache", NULL, MTX_DEF);
sc->last_blk = -1;