diff options
author | Thomas White <taw@physics.org> | 2011-07-05 11:58:15 +0200 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2012-02-22 15:27:31 +0100 |
commit | c0c41d642a84f033b02ffb14c105347e49e10b87 (patch) | |
tree | 267df597e145b3d62a8705623922e129aaf23e1c | |
parent | b0bba0be534273be614f60dffac2fad4ff16323e (diff) |
Don't crash when freeing an empty RefList
-rw-r--r-- | src/reflist.c | 4 |
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); } |