aboutsummaryrefslogtreecommitdiff
path: root/fontconfig/src/fccfg.c
diff options
context:
space:
mode:
Diffstat (limited to 'fontconfig/src/fccfg.c')
-rw-r--r--fontconfig/src/fccfg.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/fontconfig/src/fccfg.c b/fontconfig/src/fccfg.c
index f8ee8d20e..55cb297cd 100644
--- a/fontconfig/src/fccfg.c
+++ b/fontconfig/src/fccfg.c
@@ -434,6 +434,7 @@ retry:
if (!fc_atomic_ptr_cmpexch (&_fcConfig, cfg, config))
goto retry;
+ FcConfigReference (config);
if (cfg)
FcConfigDestroy (cfg);
@@ -2405,6 +2406,10 @@ FcConfigSetSysRoot (FcConfig *config,
{
config = FcInitLoadOwnConfigAndFonts (config);
FcConfigSetCurrent (config);
+ /* FcConfigSetCurrent() increases the refcount.
+ * decrease it here to avoid the memory leak.
+ */
+ FcConfigDestroy (config);
}
}