aboutsummaryrefslogtreecommitdiff
path: root/libcrystfel/src/indexers/fromfile.c
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2021-07-21 11:51:56 +0200
committerThomas White <taw@physics.org>2021-07-21 15:34:31 +0200
commit6d94d4115c254d344bbb927596a7141ef39fd298 (patch)
tree652d07c4d6a9521c9359aa13bbda27309f53e6f8 /libcrystfel/src/indexers/fromfile.c
parent50cf52b0bc0baa683b9508568131a3f6281bf4ff (diff)
Add missing cleanup on error paths
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;