Blame SOURCES/fontconfig-fix-memleaks.patch

4a5b52
From 684c3ce6850c4168e127ea84432e7a9006296ff4 Mon Sep 17 00:00:00 2001
4a5b52
From: Akira TAGOH <akira@tagoh.org>
4a5b52
Date: Fri, 25 May 2018 13:51:10 +0900
4a5b52
Subject: [PATCH 1/7] Fix leaks
4a5b52
4a5b52
---
4a5b52
 src/fcxml.c | 9 +++++++++
4a5b52
 1 file changed, 9 insertions(+)
4a5b52
4a5b52
diff --git a/src/fcxml.c b/src/fcxml.c
4a5b52
index 1ee1ba1..c69ee50 100644
4a5b52
--- a/src/fcxml.c
4a5b52
+++ b/src/fcxml.c
4a5b52
@@ -2777,6 +2777,11 @@ FcParseAcceptRejectFont (FcConfigParse *parse, FcElement element)
4a5b52
 	    {
4a5b52
 		FcConfigMessage (parse, FcSevereError, "out of memory");
4a5b52
 	    }
4a5b52
+	    else
4a5b52
+	    {
4a5b52
+		if (parse->scanOnly && vstack->u.string)
4a5b52
+		    FcStrFree (vstack->u.string);
4a5b52
+	    }
4a5b52
 	    break;
4a5b52
 	case FcVStackPattern:
4a5b52
 	    if (!parse->scanOnly && !FcConfigPatternsAdd (parse->config,
4a5b52
@@ -2786,7 +2791,11 @@ FcParseAcceptRejectFont (FcConfigParse *parse, FcElement element)
4a5b52
 		FcConfigMessage (parse, FcSevereError, "out of memory");
4a5b52
 	    }
4a5b52
 	    else
4a5b52
+	    {
4a5b52
+		if (parse->scanOnly && vstack->u.pattern)
4a5b52
+		    FcPatternDestroy (vstack->u.pattern);
4a5b52
 		vstack->tag = FcVStackNone;
4a5b52
+	    }
4a5b52
 	    break;
4a5b52
 	default:
4a5b52
 	    FcConfigMessage (parse, FcSevereWarning, "bad font selector");
4a5b52
-- 
4a5b52
2.17.1
4a5b52