mirror of
https://github.com/freebsd/freebsd-src
synced 2024-10-06 00:20:29 +00:00
Make sure we don't free memory that's already been freed by setting
the geom->softc pounter to NULL before freeing the g_slicer softc. In g_slicer_free() the pointer is checked first. Obtained from: Juniper Networks, Inc.
This commit is contained in:
parent
2d1e88da97
commit
12b2d77da9
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=264184
|
@ -534,11 +534,14 @@ g_slice_new(struct g_class *mp, u_int slices, struct g_provider *pp, struct g_co
|
|||
void
|
||||
g_slice_orphan(struct g_consumer *cp)
|
||||
{
|
||||
struct g_slicer *gsp;
|
||||
|
||||
g_trace(G_T_TOPOLOGY, "g_slice_orphan(%p/%s)", cp, cp->provider->name);
|
||||
g_topology_assert();
|
||||
|
||||
/* XXX: Not good enough we leak the softc and its suballocations */
|
||||
g_slice_free(cp->geom->softc);
|
||||
gsp = cp->geom->softc;
|
||||
cp->geom->softc = NULL;
|
||||
g_slice_free(gsp);
|
||||
g_wither_geom(cp->geom, ENXIO);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue