[Fontconfig] fontconfig: Branch 'master' - 5 commits

Akira TAGOH tagoh at kemper.freedesktop.org
Fri Jul 27 03:21:42 UTC 2018


 src/fcptrlist.c |    2 ++
 src/fcstr.c     |    2 +-
 src/fcxml.c     |    9 +++------
 3 files changed, 6 insertions(+), 7 deletions(-)

New commits:
commit 1451f829e750926cec27855eded71c24ac7ac7c6
Author: Tom Anderson <thomasanderson at chromium.org>
Date:   Wed Jul 25 16:35:54 2018 -0700

    Fix build with CFLAGS="-std=c11 -D_GNU_SOURCE"

diff --git a/src/fcxml.c b/src/fcxml.c
index a180a88..7797502 100644
--- a/src/fcxml.c
+++ b/src/fcxml.c
@@ -22,9 +22,6 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-#ifdef _GNU_SOURCE
-#undef _GNU_SOURCE /* To use the POSIX version of strerror_r */
-#endif
 #include <string.h>
 #include "fcint.h"
 #include <fcntl.h>
@@ -3474,8 +3471,7 @@ _FcConfigParse (FcConfig	*config,
 	    char ebuf[BUFSIZ+1];
 
 #if HAVE_STRERROR_R
-	    int x FC_UNUSED;
-	    x = strerror_r (errno_, ebuf, BUFSIZ); /* make sure we use the POSIX version of strerror_r */
+	    strerror_r (errno_, ebuf, BUFSIZ);
 #elif HAVE_STRERROR
 	    char *tmp = strerror (errno_);
 	    size_t len = strlen (tmp);
commit 9f1b92f27f9259aa69e5387656cb7d4c1b305a98
Author: Akira TAGOH <akira at tagoh.org>
Date:   Wed Jul 25 13:41:47 2018 +0900

    Fix memory leak

diff --git a/src/fcxml.c b/src/fcxml.c
index 94f5d63..a180a88 100644
--- a/src/fcxml.c
+++ b/src/fcxml.c
@@ -1837,6 +1837,8 @@ FcParseAlias (FcConfigParse *parse)
 	!def)
     {
 	FcExprDestroy (family);
+	if (rule)
+	    FcRuleDestroy (rule);
 	return;
     }
     else
commit 5b277806df6d8776c68b275c227a82dd8433eeae
Author: Akira TAGOH <akira at tagoh.org>
Date:   Wed Jul 25 12:44:38 2018 +0900

    Drop the redundant code
    
    "value == FcTypeInteger" won't be true because it was converted to FcTypeDouble earlier

diff --git a/src/fcxml.c b/src/fcxml.c
index d27727f..94f5d63 100644
--- a/src/fcxml.c
+++ b/src/fcxml.c
@@ -649,7 +649,6 @@ FcTypecheckValue (FcConfigParse *parse, FcType value, FcType type)
     {
 	if ((value == FcTypeLangSet && type == FcTypeString) ||
 	    (value == FcTypeString && type == FcTypeLangSet) ||
-	    (value == FcTypeInteger && type == FcTypeRange) ||
 	    (value == FcTypeDouble && type == FcTypeRange))
 	    return;
 	if (type ==  FcTypeUnknown)
commit a1ad5fe2ba3d742f79d601a1149e1456e57ff51e
Author: Akira TAGOH <akira at tagoh.org>
Date:   Wed Jul 25 12:40:17 2018 +0900

    Allocate sufficient memory to terminate with null

diff --git a/src/fcstr.c b/src/fcstr.c
index 4d33ea5..bfddd68 100644
--- a/src/fcstr.c
+++ b/src/fcstr.c
@@ -953,7 +953,7 @@ FcStrCopyFilename (const FcChar8 *s)
 	if (!home)
 	    return NULL;
 	size = strlen ((char *) home) + strlen ((char *) s);
-	full = (FcChar8 *) malloc (size);
+	full = (FcChar8 *) malloc (size + 1);
 	if (!full)
 	    return NULL;
 	strcpy ((char *) full, (char *) home);
commit 5ea2ab6a3857855dd676388d81d2b4f6f327ae2a
Author: Akira TAGOH <akira at tagoh.org>
Date:   Wed Jul 25 12:39:53 2018 +0900

    Make a call fail on ENOMEM

diff --git a/src/fcptrlist.c b/src/fcptrlist.c
index a0688dd..bb88832 100644
--- a/src/fcptrlist.c
+++ b/src/fcptrlist.c
@@ -143,6 +143,8 @@ FcPtrListIterAdd (FcPtrList	*list,
 	return FcFalse;
 
     e = (FcPtrListEntry *) malloc (sizeof (FcPtrListEntry));
+    if (!e)
+	return FcFalse;
     e->data = data;
 
     if (priv->entry)


More information about the Fontconfig mailing list