aboutsummaryrefslogtreecommitdiff
path: root/src/reflist.c
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2011-07-06 10:33:40 +0200
committerThomas White <taw@physics.org>2012-02-22 15:27:32 +0100
commit0f999711faf88be7f22544ae87c506ba9cc7c90a (patch)
treeb34504019952e0f341990b6008c035a89339eb35 /src/reflist.c
parent8ad494ee8ce59292003aa8bae1a9909c989bdec7 (diff)
Don't forget to free the linked list of reflections
Diffstat (limited to 'src/reflist.c')
-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;
+ }
}