+2005-11-02 Patrick Lam <plam@mit.edu>
+ * src/fcfreetype.c (FcFreetypeQuery):
+ * src/fcpat.c (FcPatternDestroy, FcPatternDuplicate,
+ FcPatternTransferFullFname):
+
+ Fix warnings and embarrassing double-free error.
+
2005-11-02 Zhe Su <zsu@novell.com>
reviewed by: plam
if (!FcPatternAddString (pat, FC_FILE, (FcChar8 *)basename((char *)FcStrCopy(file))))
goto bail1;
- FcPatternAddFullFname (pat, (const char *)file);
+ FcPatternAddFullFname (pat, (const char *)FcStrCopy (file));
if (!FcPatternAddInteger (pat, FC_INDEX, id))
goto bail1;
if (FcPatternFindFullFname (p))
{
- FcStrFree (FcPatternFindFullFname (p));
+ FcStrFree ((FcChar8 *)FcPatternFindFullFname (p));
FcPatternAddFullFname (p, 0);
}
FcValueCanonicalize(&FcValueListPtrU(l)->value),
FcTrue))
goto bail1;
-
- if (!strcmp ((char *)FcObjectPtrU((e + i)->object), FC_FILE))
- {
- FcChar8 * s;
- FcPatternGetString (orig, FC_FILE, 0, &s);
- FcPatternAddFullFname (new, FcPatternFindFullFname(orig));
- }
}
+ FcPatternTransferFullFname (orig, new);
return new;
{
FcChar8 * s;
FcPatternGetString (orig, FC_FILE, 0, &s);
- FcPatternAddFullFname (new, FcStrCopy (FcPatternFindFullFname(orig)));
+ FcPatternAddFullFname (new,
+ (char *)FcStrCopy
+ ((FcChar8 *)FcPatternFindFullFname(orig)));
}