aboutsummaryrefslogtreecommitdiff
path: root/libcrystfel/src/indexers/fromfile.c
diff options
context:
space:
mode:
Diffstat (limited to 'libcrystfel/src/indexers/fromfile.c')
-rw-r--r--libcrystfel/src/indexers/fromfile.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/libcrystfel/src/indexers/fromfile.c b/libcrystfel/src/indexers/fromfile.c
index f0372489..d7dfbd09 100644
--- a/libcrystfel/src/indexers/fromfile.c
+++ b/libcrystfel/src/indexers/fromfile.c
@@ -211,7 +211,10 @@ void *fromfile_prepare(IndexingMethod *indm, struct fromfile_options *opts)
}
dp = malloc(sizeof(struct fromfile_private));
- if ( dp == NULL ) return NULL;
+ if ( dp == NULL ) {
+ fclose(fh);
+ return NULL;
+ }
dp->sol_hash = NULL;