]> git.wh0rd.org - fontconfig.git/blobdiff - src/fccharset.c
Don't use FcCharSetCopy in FcCharSetMerge
[fontconfig.git] / src / fccharset.c
index 1891f08f01ae28b6d05b45442c4a81cceb3625c5..2daa39d59bef9ef68b43257505e11dfb7a359d34 100644 (file)
@@ -459,14 +459,15 @@ FcCharSetMerge (FcCharSet *a, const FcCharSet *b)
     FcCharSetIter    ai, bi;
 
     if (a == NULL) {
-       return FcCharSetCopy ((FcCharSet *) b);
+       fcs = a = FcCharSetCreate ();
     } else if (a->ref == FC_REF_CONSTANT) {
        fcs = FcCharSetCreate ();
-       if (fcs == NULL)
-           return NULL;
     } else
        fcs = a;
 
+    if (fcs == NULL)
+       return NULL;
+
     FcCharSetIterStart (a, &ai);
     FcCharSetIterStart (b, &bi);
     while (ai.leaf || bi.leaf)