Use g_slice_spoiled() instead of g_std_spoiled().

Add XXX comment about minor memory leak until I can fix it.
This commit is contained in:
phk 2003-05-02 08:33:26 +00:00
parent 7636503a41
commit 94c69d48c9

View File

@ -188,6 +188,7 @@ g_gpt_taste(struct g_class *mp, struct g_provider *pp, int insist)
ent = (void*)(buf + i * hdr->hdr_entsz);
if (!memcmp(&ent->ent_type, &unused, sizeof(unused)))
continue;
/* XXX: This memory leaks */
gs->part[i] = g_malloc(hdr->hdr_entsz, M_WAITOK);
if (gs->part[i] == NULL)
break;
@ -214,7 +215,7 @@ g_gpt_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);