From ed52e6254af11ca6df5d52c5aa42f0bc61d3e4c1 Mon Sep 17 00:00:00 2001 From: Thomas White Date: Tue, 4 Dec 2018 15:07:00 +0100 Subject: partialator: Fix leaked file handle --- src/post-refinement.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/post-refinement.c b/src/post-refinement.c index b1af92db..4ae72685 100644 --- a/src/post-refinement.c +++ b/src/post-refinement.c @@ -851,7 +851,6 @@ static void do_pr_refine(Crystal *cr, const RefList *full, rad2deg(get_actual_val(min->x, priv.initial, priv.rv, 1)), get_actual_val(min->x, priv.initial, priv.rv, 2), get_actual_val(min->x, priv.initial, priv.rv, 3)*1e10); - fclose(fh); } /* Apply the final shifts */ @@ -884,6 +883,10 @@ static void do_pr_refine(Crystal *cr, const RefList *full, ERROR("Very large radius: crystal %i\n", serial); } + if ( fh != NULL ) { + fclose(fh); + } + gsl_multimin_fminimizer_free(min); gsl_vector_free(priv.initial); gsl_vector_free(priv.vals); -- cgit v1.2.3