aboutsummaryrefslogtreecommitdiff
path: root/fontconfig/src/fcinit.c
diff options
context:
space:
mode:
Diffstat (limited to 'fontconfig/src/fcinit.c')
-rw-r--r--fontconfig/src/fcinit.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/fontconfig/src/fcinit.c b/fontconfig/src/fcinit.c
index 1e23c1fbb..db62c21f2 100644
--- a/fontconfig/src/fcinit.c
+++ b/fontconfig/src/fcinit.c
@@ -189,11 +189,18 @@ FcBool
FcInitReinitialize (void)
{
FcConfig *config;
+ FcBool ret;
config = FcInitLoadConfigAndFonts ();
if (!config)
return FcFalse;
- return FcConfigSetCurrent (config);
+ ret = FcConfigSetCurrent (config);
+ /* FcConfigSetCurrent() increases the refcount.
+ * decrease it here to avoid the memory leak.
+ */
+ FcConfigDestroy (config);
+
+ return ret;
}
FcBool