FcAtomicDestroy (FcAtomic *atomic)
{
FcMemFree (FC_MEM_ATOMIC, sizeof (FcAtomic) +
- strlen ((char *) atomic->file) * 4 + 1 +
+ strlen ((char *) atomic->file) * 4 + 4 +
sizeof (NEW_NAME) + sizeof (LCK_NAME) +
sizeof (TMP_NAME));
for (ent = freezer->set_hash_table[i]; ent; ent = next)
{
next = ent->next;
+ FcMemFree (FC_MEM_CHARSET, (sizeof (FcCharSetEnt) +
+ ent->set.num * sizeof (FcCharLeaf *) +
+ ent->set.num * sizeof (FcChar16)));
free (ent);
}
}
}
for (i = 0; i < freezer->leaf_block_count; i++)
+ {
free (freezer->leaf_blocks[i]);
+ FcMemFree (FC_MEM_CHARLEAF, FC_CHAR_LEAF_BLOCK * sizeof (FcCharLeafEnt));
+ }
free (freezer->leaf_blocks);
free (freezer);
FcPatternFini ();
FcCacheFini ();
+ if (FcDebug() & FC_DBG_MEMORY)
+ FcMemReport ();
}
/*
next = b->next;
name = (char *) (b + 1);
size = sizeof (struct objectBucket) + strlen (name) + 1;
- FcMemFree (FC_MEM_STATICSTR, size);
+ FcMemFree (FC_MEM_STATICSTR, size + sizeof (int));
free (b);
}
FcObjectBuckets[i] = 0;
if (!strs)
return FcFalse;
FcMemAlloc (FC_MEM_STRSET, (set->size + 2) * sizeof (FcChar8 *));
- set->size = set->size + 1;
if (set->num)
memcpy (strs, set->strs, set->num * sizeof (FcChar8 *));
if (set->strs)
+ {
+ FcMemFree (FC_MEM_STRSET, (set->size + 1) * sizeof (FcChar8 *));
free (set->strs);
+ }
+ set->size = set->size + 1;
set->strs = strs;
}
set->strs[set->num++] = s;
for (i = 0; i < set->num; i++)
FcStrFree (set->strs[i]);
- FcMemFree (FC_MEM_STRSET, (set->size) * sizeof (FcChar8 *));
if (set->strs)
+ {
+ FcMemFree (FC_MEM_STRSET, (set->size + 1) * sizeof (FcChar8 *));
free (set->strs);
+ }
FcMemFree (FC_MEM_STRSET, sizeof (FcStrSet));
free (set);
}