Fix warnings and embarrassing double-free error.

This commit is contained in:
Patrick Lam 2005-11-03 04:23:22 +00:00
parent efa9f2bd07
commit 7358dae49b
3 changed files with 13 additions and 10 deletions

View File

@ -1,3 +1,10 @@
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

View File

@ -1291,7 +1291,7 @@ FcFreeTypeQuery (const FcChar8 *file,
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;

View File

@ -309,7 +309,7 @@ FcPatternDestroy (FcPattern *p)
if (FcPatternFindFullFname (p))
{
FcStrFree (FcPatternFindFullFname (p));
FcStrFree ((FcChar8 *)FcPatternFindFullFname (p));
FcPatternAddFullFname (p, 0);
}
@ -1276,14 +1276,8 @@ FcPatternDuplicate (const FcPattern *orig)
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;
@ -2003,5 +1997,7 @@ FcPatternTransferFullFname (const FcPattern *new, const FcPattern *orig)
{
FcChar8 * s;
FcPatternGetString (orig, FC_FILE, 0, &s);
FcPatternAddFullFname (new, FcStrCopy (FcPatternFindFullFname(orig)));
FcPatternAddFullFname (new,
(char *)FcStrCopy
((FcChar8 *)FcPatternFindFullFname(orig)));
}