Do not manually use FcConfigFilename; passing a NULL pointer to
FcConfigParseAndLoad is just as effective and also avoids a memory leak
since the string allocated by FcConfigFilename was never freed.
Free FcConfig instance in fontconfig_done; since we're not using the
default configuration anymore it doesn't make sense to keep the
configuration around.
Leaks were found by valgrind/memcheck.
goto exit;
}
- if (!config)
- config = (char *) FcConfigFilename(NULL);
-
priv->config = FcConfigCreate();
rc = FcConfigParseAndLoad(priv->config, (unsigned char *) config, FcTrue);
if (!rc) {
void fontconfig_done(fc_instance_t *priv)
{
- // don't call FcFini() here, library can still be used by some code
+ if (priv && priv->config)
+ FcConfigDestroy(priv->config);
if (priv && priv->path_default)
free(priv->path_default);
if (priv && priv->family_default)