aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/reflist.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/reflist.c b/src/reflist.c
index 83f384c4..b51af27c 100644
--- a/src/reflist.c
+++ b/src/reflist.c
@@ -162,7 +162,12 @@ static void recursive_free(Reflection *refl)
{
if ( refl->child[0] != NULL ) recursive_free(refl->child[0]);
if ( refl->child[1] != NULL ) recursive_free(refl->child[1]);
- free(refl);
+
+ while ( refl != NULL ) {
+ Reflection *next = refl->next;
+ free(refl);
+ refl = next;
+ }
}