summaryrefslogtreecommitdiff
path: root/src/fccfg.c
diff options
context:
space:
mode:
authorPatrick Lam <plam@MIT.EDU>2006-04-10 19:33:03 +0000
committerPatrick Lam <plam@MIT.EDU>2006-04-10 19:33:03 +0000
commit3ea92166a0e45b0c7d7e9ecc0546317640c50336 (patch)
treefc96577cc0d1314a758485a77f236aa9fac6393b /src/fccfg.c
parentc814c301ee4dcc67eeacee9608fb716e67534356 (diff)
Fix string memory leak (Coverity defect #1823).
Fix memory leak with hash collision (Coverity defect #1824). reviewed by: plam
Diffstat (limited to 'src/fccfg.c')
-rw-r--r--src/fccfg.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/fccfg.c b/src/fccfg.c
index 7f8a8ff2..fc70fefd 100644
--- a/src/fccfg.c
+++ b/src/fccfg.c
@@ -893,6 +893,7 @@ FcConfigEvaluate (FcPattern *p, FcExpr *e)
FcValue v, vl, vr;
FcResult r;
FcMatrix *m;
+ FcChar8 *str;
switch (e->op) {
case FcOpInteger:
@@ -1023,7 +1024,9 @@ FcConfigEvaluate (FcPattern *p, FcExpr *e)
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;