From 4a5e6b854d15e5eabfaa31d7e6621d889bf939ed Mon Sep 17 00:00:00 2001 From: "Pedro F. Giffuni" Date: Mon, 20 Apr 2015 16:31:27 +0000 Subject: [PATCH] g_uncompress_taste: prevent a double free. Found by: Clang Static Analyzer MFC after: 1 week --- sys/geom/uncompress/g_uncompress.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/geom/uncompress/g_uncompress.c b/sys/geom/uncompress/g_uncompress.c index 5bc8d30bc1de..d8193711b5e7 100644 --- a/sys/geom/uncompress/g_uncompress.c +++ b/sys/geom/uncompress/g_uncompress.c @@ -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;