]> git.wh0rd.org - fontconfig.git/blobdiff - src/fccfg.c
Fix memory leak (Coverity defect #2089).
[fontconfig.git] / src / fccfg.c
index 35ab73a9aa79c70def7e20f0bd999a9208c24068..cf92a2f0a5a4493e355ef05f517c09eca415e296 100644 (file)
@@ -1512,7 +1512,8 @@ FcConfigSubstituteWithPat (FcConfig    *config,
                    /*
                     * Delete the marked value
                     */
-                   FcConfigDel (&st[i].elt->values, thisValue);
+                    if (thisValue)
+                       FcConfigDel (&st[i].elt->values, thisValue);
                    /*
                     * Adjust any pointers into the value list to ensure
                     * future edits occur at the same place
@@ -1567,6 +1568,7 @@ FcConfigSubstituteWithPat (FcConfig    *config,
                FcConfigPatternAdd (p, e->field, l, FcTrue);
                break;
            default:
+                FcValueListDestroy (FcValueListPtrCreateDynamic(l));
                break;
            }
        }