From 52ac91f7c1a8a6433851cbde8ccade618f0218e4 Mon Sep 17 00:00:00 2001 From: Patrick Lam Date: Mon, 2 Jan 2006 17:20:23 +0000 Subject: [PATCH] Fix double-free which occurs because FcValueCanonicalize doesn't create an extra copy of the returned value, it only canonicalizes it. reviewed by: plam --- ChangeLog | 11 ++++++++++- src/fccfg.c | 1 + 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 1429221..ee3fb89 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,13 @@ -2005-01-02 Patrick Lam +2006-01-02 Lubos Lunak + reviewed by: plam + + * src/fccfg.c (FcConfigEvaluate): + + Fix double-free which occurs because FcValueCanonicalize doesn't + create an extra copy of the returned value, it only canonicalizes + it. + +2006-01-02 Patrick Lam * doc/fontconfig-user.sgml: Fix version of .cache file (currently 1 -> currently 2). Reported diff --git a/src/fccfg.c b/src/fccfg.c index 56c1a3e..eefbca9 100644 --- a/src/fccfg.c +++ b/src/fccfg.c @@ -823,6 +823,7 @@ FcConfigEvaluate (FcPattern *p, FcExpr *e) r = FcPatternGet (p, e->u.field, 0, &v); if (r != FcResultMatch) v.type = FcTypeVoid; + v = FcValueSave (v); break; case FcOpConst: if (FcNameConstant (e->u.constant, &v.u.i)) -- 2.39.5