summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2022-08-08 20:13:14 (GMT)
committerJunio C Hamano <gitster@pobox.com>2022-08-08 20:13:14 (GMT)
commitbac92b1f39f7b670d7b2c32c892551aa3fb5b2e5 (patch)
treec00c99c6a153123393b25da11877b95d88f0483b
parentb9654bee995b1e6a2f106cd57e763854dbf06286 (diff)
parent1250dff32bff164e10ffdad19c0dcb5ec0db32d1 (diff)
downloadgit-bac92b1f39f7b670d7b2c32c892551aa3fb5b2e5.zip
git-bac92b1f39f7b670d7b2c32c892551aa3fb5b2e5.tar.gz
git-bac92b1f39f7b670d7b2c32c892551aa3fb5b2e5.tar.bz2
Merge branch 'js/ort-clean-up-after-failed-merge'
Plug memory leaks in the failure code path in the "merge-ort" merge strategy backend. * js/ort-clean-up-after-failed-merge: merge-ort: do leave trace2 region even if checkout fails merge-ort: clean up after failed merge
-rw-r--r--merge-ort.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/merge-ort.c b/merge-ort.c
index 8b7de0f..7d105be 100644
--- a/merge-ort.c
+++ b/merge-ort.c
@@ -4536,6 +4536,8 @@ void merge_switch_to_result(struct merge_options *opt,
if (checkout(opt, head, result->tree)) {
/* failure to function */
result->clean = -1;
+ merge_finalize(opt, result);
+ trace2_region_leave("merge", "checkout", opt->repo);
return;
}
trace2_region_leave("merge", "checkout", opt->repo);
@@ -4546,6 +4548,9 @@ void merge_switch_to_result(struct merge_options *opt,
/* failure to function */
opt->priv = NULL;
result->clean = -1;
+ merge_finalize(opt, result);
+ trace2_region_leave("merge", "record_conflicted",
+ opt->repo);
return;
}
opt->priv = NULL;