From b05bd432709241bcbcdae69f6cf946f4849a34aa484de639924fad325a38e8b3 Mon Sep 17 00:00:00 2001 From: OBS User unknown Date: Mon, 23 Feb 2009 21:50:33 +0000 Subject: [PATCH] OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/fontconfig?expand=0&rev=23 --- fontconfig-2.6.0-leaks.patch | 61 ++++++++++++++++++++++++++++++++++++ fontconfig.changes | 5 +++ fontconfig.spec | 6 +++- 3 files changed, 71 insertions(+), 1 deletion(-) create mode 100644 fontconfig-2.6.0-leaks.patch diff --git a/fontconfig-2.6.0-leaks.patch b/fontconfig-2.6.0-leaks.patch new file mode 100644 index 0000000..1516de5 --- /dev/null +++ b/fontconfig-2.6.0-leaks.patch @@ -0,0 +1,61 @@ +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; + } diff --git a/fontconfig.changes b/fontconfig.changes index bc137cb..f3518e4 100644 --- a/fontconfig.changes +++ b/fontconfig.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Mon Feb 23 19:12:01 CET 2009 - crrodriguez@suse.de + +- fontconfig leaks memory [bnc#302498] + ------------------------------------------------------------------- Thu Feb 05 13:02:59 CET 2009 - mfabian@suse.de diff --git a/fontconfig.spec b/fontconfig.spec index 6dff163..bb461ed 100644 --- a/fontconfig.spec +++ b/fontconfig.spec @@ -35,7 +35,7 @@ Obsoletes: fontconfig-64bit %endif Requires: bash Version: 2.6.0 -Release: 11 +Release: 12 Summary: Library for Font Configuration # CVS can be found here: (CVS is gone, fontconfig uses git now). # $ cvs -d :pserver:anoncvs@pdx.freedesktop.org:/cvs/fontconfig login @@ -70,6 +70,7 @@ Patch30: bugzilla-179457-fix-font-file-names-for-wine.patch Patch31: bugzilla-246783-do-not-crash-when-config-files-contain-broken-stuff.patch Patch32: usr-share-doc-packages.patch Patch33: bnc438855-make-FcInitReinitialize-work-again.patch +Patch34: fontconfig-2.6.0-leaks.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build %description @@ -130,6 +131,7 @@ Authors: %patch31 -p1 %patch32 -p1 %patch33 -p1 +%patch34 -p1 %build %configure --with-pic \ @@ -242,6 +244,8 @@ rm -rf $RPM_BUILD_ROOT %{_includedir}/fontconfig/ %changelog +* Mon Feb 23 2009 crrodriguez@suse.de +- fontconfig leaks memory [bnc#302498] * Thu Feb 05 2009 mfabian@suse.de - cleanup old patches: • remove obsolete fc-app-dir-fix-new-new.diff