aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2015-07-09 15:57:02 +0200
committerThomas White <taw@physics.org>2015-07-09 15:57:31 +0200
commit235e8eb20240af5266b064ee931bc6723004bf4d (patch)
tree5487935a1ef56926c63baa5bb98c63d8c9718d01 /src
parentd80615db26ff88e3c925e58eeaa122dc7b818dd6 (diff)
Tidy up error handling when given dodgy data locations
Diffstat (limited to 'src')
-rw-r--r--src/dw-hdfsee.c1
-rw-r--r--src/im-sandbox.c4
2 files changed, 4 insertions, 1 deletions
diff --git a/src/dw-hdfsee.c b/src/dw-hdfsee.c
index 2549321c..5362bca7 100644
--- a/src/dw-hdfsee.c
+++ b/src/dw-hdfsee.c
@@ -2831,7 +2831,6 @@ DisplayWindow *displaywindow_open(char *filename, char *geom_filename,
if ( dw->ev_list == NULL ) {
ERROR("Error while parsing file structure\n");
- free_event_list(dw->ev_list);
free(dw->geom_filename);
free(dw);
return NULL;
diff --git a/src/im-sandbox.c b/src/im-sandbox.c
index 36150a1b..f796b8b7 100644
--- a/src/im-sandbox.c
+++ b/src/im-sandbox.c
@@ -222,6 +222,10 @@ static struct filename_plus_event *get_pattern(FILE *fh, int config_basename,
}
ev_list = fill_event_list(hdfile, det);
+ if ( ev_list == NULL ) {
+ ERROR("Failed to get event list.\n");
+ return NULL;
+ }
if ( ev_list->num_events == 0 ) {
event_index = -1;