aboutsummaryrefslogtreecommitdiff
path: root/src/reflist.c
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2011-07-05 11:58:15 +0200
committerThomas White <taw@physics.org>2012-02-22 15:27:31 +0100
commitc0c41d642a84f033b02ffb14c105347e49e10b87 (patch)
tree267df597e145b3d62a8705623922e129aaf23e1c /src/reflist.c
parentb0bba0be534273be614f60dffac2fad4ff16323e (diff)
Don't crash when freeing an empty RefList
Diffstat (limited to 'src/reflist.c')
-rw-r--r--src/reflist.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/reflist.c b/src/reflist.c
index 19d5b1a4..5ab99635 100644
--- a/src/reflist.c
+++ b/src/reflist.c
@@ -177,7 +177,9 @@ static void recursive_free(Reflection *refl)
void reflist_free(RefList *list)
{
if ( list == NULL ) return;
- recursive_free(list->head);
+ if ( list->head != NULL ) {
+ recursive_free(list->head);
+ } /* else empty list */
free(list);
}