]> git.wh0rd.org - fontconfig.git/blobdiff - src/fcxml.c
Fix crash reported by Frederic Crozat when using libxml2.
[fontconfig.git] / src / fcxml.c
index 57fd606bf20660286a232aef92368faa9c3ba367..ce92f649cc2d7107f47d9178e17c059b02841020 100644 (file)
@@ -1024,6 +1024,9 @@ FcConfigGetAttribute (FcConfigParse *parse, const char *attr)
        return 0;
 
     attrs = parse->pstack->attr;
+    if (!attrs)
+        return 0;
+
     while (*attrs)
     {
        if (!strcmp ((char *) *attrs, attr))
@@ -2368,6 +2371,12 @@ FcConfigParseAndLoad (FcConfig       *config,
     if (!filename)
        goto bail0;
     
+    if (FcStrSetMember (config->configFiles, filename))
+    {
+        FcStrFree (filename);
+        return FcTrue;
+    }
+
     if (!FcStrSetAdd (config->configFiles, filename))
     {
        FcStrFree (filename);