aboutsummaryrefslogtreecommitdiff
path: root/src/gui_merge.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 /src/gui_merge.c
parent50cf52b0bc0baa683b9508568131a3f6281bf4ff (diff)
Add missing cleanup on error paths
Diffstat (limited to 'src/gui_merge.c')
-rw-r--r--src/gui_merge.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/gui_merge.c b/src/gui_merge.c
index b911fa5a..ca3c3a46 100644
--- a/src/gui_merge.c
+++ b/src/gui_merge.c
@@ -364,7 +364,10 @@ static int write_partialator_script(const char *filename,
fprintf(fh, "#!/bin/sh\n");
exe_path = get_crystfel_exe("partialator");
- if ( exe_path == NULL ) return 1;
+ if ( exe_path == NULL ) {
+ fclose(fh);
+ return 1;
+ }
fprintf(fh, "%s \\\n", exe_path);
for ( i=0; i<input->n_streams; i++ ) {
@@ -468,7 +471,10 @@ static int write_process_hkl_script(const char *filename,
fprintf(fh, "#!/bin/sh\n");
exe_path = get_crystfel_exe("process_hkl");
- if ( exe_path == NULL ) return 1;
+ if ( exe_path == NULL ) {
+ fclose(fh);
+ return 1;
+ }
add_process_hkl(fh, exe_path, input, params, out_hkl,
stdout_filename, stderr_filename, "", "");