The following patch fixes two memory leaks and one invalid memory access (memory is access after being freed) in fcxml.c (Coverity defects #789, #780, #781). -- Frederic Crozat <fcrozat@xxxxxxxxxxxx> Mandriva
Index: ChangeLog =================================================================== RCS file: /cvs/fontconfig/fontconfig/ChangeLog,v retrieving revision 1.109.2.193 diff -u -p -r1.109.2.193 ChangeLog --- ChangeLog 11 Apr 2006 14:20:59 -0000 1.109.2.193 +++ ChangeLog 11 Apr 2006 15:41:25 -0000 @@ -1,3 +1,9 @@ +2006-04-11 Frederic Crozat <fcrozat@xxxxxxxxxxxx> + + * src/fcxml.c: (FcPopBinary), (FcParsePatelt), (FcParsePattern): + Fix memory leaks (Coverity defects #779, #781) + and memory use after free (Coverity defect #780). + 2006-04-11 Patrick Lam <plam@xxxxxxx> * src/fccharset.c (FcCharSetPutLeaf): Index: src/fcxml.c =================================================================== RCS file: /cvs/fontconfig/fontconfig/src/fcxml.c,v retrieving revision 1.37.4.19 diff -u -p -r1.37.4.19 fcxml.c --- src/fcxml.c 6 Apr 2006 04:52:21 -0000 1.37.4.19 +++ src/fcxml.c 11 Apr 2006 15:41:25 -0000 @@ -1541,7 +1541,7 @@ FcConfigMessage (parse, FcSevereError, "out of memory"); FcExprDestroy (left); FcExprDestroy (expr); - break; + return 0; } expr = new; } @@ -1949,6 +1949,7 @@ name = (char *) FcConfigGetAttribute (parse, "name"); if (!name) { + FcPatternDestroy (pattern); FcConfigMessage (parse, FcSevereWarning, "missing pattern element name"); return; } @@ -1988,6 +1989,7 @@ if (!FcPatternAppend (pattern, vstack->u.pattern)) { FcConfigMessage (parse, FcSevereError, "out of memory"); + FcPatternDestroy (pattern); return; } break;
_______________________________________________ Fontconfig mailing list Fontconfig@xxxxxxxxxxxxxxxxxxxxx http://lists.freedesktop.org/mailman/listinfo/fontconfig