Fix memory leak with hash collision (Coverity defect #1824).
reviewed by: plam
+2006-04-10 Frederic Crozat <fcrozat@mandriva.com>
+ reviewed by: plam
+
+ * src/fccfg.c: (FcConfigEvaluate):
+ Fix string memory leak (Coverity defect #1823).
+
+ * src/fccache.c: (FcDirCacheUnlink):
+ Fix memory leak with hash collision (Coverity defect #1824).
+
2006-04-10 Frederic Crozat <fcrozat@mandriva.com>
reviewed by: plam
fd = open(cache_hashed, O_RDONLY | O_BINARY);
if (fd == -1)
{
+ FcStrFree ((FcChar8 *)cache_hashed);
FcStrFree ((FcChar8 *)cache_file);
return FcTrue;
}
FcValue v, vl, vr;
FcResult r;
FcMatrix *m;
+ FcChar8 *str;
switch (e->op) {
case FcOpInteger:
switch (e->op) {
case FcOpPlus:
v.type = FcTypeString;
- v.u.s = FcStrStaticName (FcStrPlus (vl.u.s, vr.u.s));
+ str = FcStrPlus (vl.u.s, vr.u.s);
+ v.u.s = FcStrStaticName (str);
+ FcStrFree (str);
if (!v.u.s)
v.type = FcTypeVoid;