diff -ru fontconfig-2.6.0.old/src/fcxml.c fontconfig-2.6.0/src/fcxml.c --- fontconfig-2.6.0.old/src/fcxml.c 2008-05-25 01:12:34.000000000 +0100 +++ fontconfig-2.6.0/src/fcxml.c 2008-09-19 14:17:20.000000000 +0100 @@ -1997,8 +1997,10 @@ if (!FcPatternAdd (pattern, name, value, FcTrue)) { FcConfigMessage (parse, FcSevereError, "out of memory"); + FcValueDestroy(value); break; } + FcValueDestroy(value); } FcVStackPushPattern (parse, pattern); diff -ru fontconfig-2.6.0.old/src/fcpat.c fontconfig-2.6.0/src/fcpat.c --- fontconfig-2.6.0.old/src/fcpat.c 2008-05-04 08:49:14.000000000 +0100 +++ fontconfig-2.6.0/src/fcpat.c 2008-09-19 14:10:48.000000000 +0100 @@ -27,7 +27,7 @@ #include static FcBool -FcStrHashed (const FcChar8 *name); +FcHashOwnsName(const FcChar8 *name); FcPattern * FcPatternCreate (void) @@ -50,7 +50,7 @@ { switch (v.type) { case FcTypeString: - if (!FcStrHashed (v.u.s)) + if (!FcHashOwnsName(v.u.s)) FcStrFree ((FcChar8 *) v.u.s); break; case FcTypeMatrix: @@ -131,7 +131,7 @@ { switch (l->value.type) { case FcTypeString: - if (!FcStrHashed ((FcChar8 *)l->value.u.s)) + if (!FcHashOwnsName((FcChar8 *)l->value.u.s)) FcStrFree ((FcChar8 *)l->value.u.s); break; case FcTypeMatrix: @@ -1004,14 +1004,14 @@ } *FcObjectBuckets[OBJECT_HASH_SIZE]; static FcBool -FcStrHashed (const FcChar8 *name) +FcHashOwnsName (const FcChar8 *name) { FcChar32 hash = FcStringHash (name); struct objectBucket **p; struct objectBucket *b; for (p = &FcObjectBuckets[hash % OBJECT_HASH_SIZE]; (b = *p); p = &(b->next)) - if (b->hash == hash && !strcmp ((char *)name, (char *) (b + 1))) + if (b->hash == hash && ((char *)name == (char *) (b + 1))) return FcTrue; return FcFalse; }