From 6d94d4115c254d344bbb927596a7141ef39fd298 Mon Sep 17 00:00:00 2001 From: Thomas White Date: Wed, 21 Jul 2021 11:51:56 +0200 Subject: Add missing cleanup on error paths --- src/gui_merge.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/gui_merge.c') 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; in_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, "", ""); -- cgit v1.2.3