aboutsummaryrefslogtreecommitdiff
path: root/fontconfig
diff options
context:
space:
mode:
Diffstat (limited to 'fontconfig')
-rw-r--r--fontconfig/src/fcxml.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/fontconfig/src/fcxml.c b/fontconfig/src/fcxml.c
index 2f3ccacab..1cac9a8b3 100644
--- a/fontconfig/src/fcxml.c
+++ b/fontconfig/src/fcxml.c
@@ -69,8 +69,8 @@ FcTestDestroy (FcTest *test)
void
FcRuleDestroy (FcRule *rule)
{
- if (rule->next)
- FcRuleDestroy (rule->next);
+ FcRule *n = rule->next;
+
switch (rule->type) {
case FcRuleTest:
FcTestDestroy (rule->u.test);
@@ -82,6 +82,8 @@ FcRuleDestroy (FcRule *rule)
break;
}
free (rule);
+ if (n)
+ FcRuleDestroy (n);
}
static FcExpr *