diff --git a/merge-ort.c b/merge-ort.c index e5f41cce48..36a140f8ed 100644 --- a/merge-ort.c +++ b/merge-ort.c @@ -4683,14 +4683,14 @@ void merge_switch_to_result(struct merge_options *opt, void merge_finalize(struct merge_options *opt, struct merge_result *result) { - struct merge_options_internal *opti = result->priv; - if (opt->renormalize) git_attr_set_direction(GIT_ATTR_CHECKIN); assert(opt->priv == NULL); - clear_or_reinit_internal_opts(opti, 0); - FREE_AND_NULL(opti); + if (result->priv) { + clear_or_reinit_internal_opts(result->priv, 0); + FREE_AND_NULL(result->priv); + } } /*** Function Grouping: helper functions for merge_incore_*() ***/