From a886ab11bb7a316f56242dc190da008611f31871 Mon Sep 17 00:00:00 2001 From: Thomas White Date: Fri, 27 Apr 2018 13:46:41 +0200 Subject: copy_event/free_event: Handle NULL event --- libcrystfel/src/events.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'libcrystfel/src') diff --git a/libcrystfel/src/events.c b/libcrystfel/src/events.c index 8e4eb861..d0e521d3 100644 --- a/libcrystfel/src/events.c +++ b/libcrystfel/src/events.c @@ -150,6 +150,8 @@ struct event *copy_event(struct event *ev) struct event *new_ev; int pi, di; + if ( ev == NULL ) return NULL; + if ( ev->dim_length == 0 && ev->path_length == 0) { new_ev = initialize_event(); @@ -252,6 +254,8 @@ void free_event(struct event *ev) { int pi; + if ( ev == NULL ) return; + if ( ev->path_length != 0 ) { for ( pi=0; pipath_length; pi++ ) { free(ev->path_entries[pi]); -- cgit v1.2.3