aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/post-refinement.c5
1 files changed, 4 insertions, 1 deletions
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);