Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2022-08-12 23:19:08 +0300
committerJunio C Hamano <gitster@pobox.com>2022-08-12 23:19:08 +0300
commit83489a5b2073cf031412a911cc7e30e6a1de27ac (patch)
tree4f836f15071141bc1e74020507d126a75e8060a0 /remote.c
parent657c7403a3c15ac670f82d0ace38bab810755e10 (diff)
parentf92dbdbc6a8aa5f3979f4bb7a7b9bbc8ec9b4aa6 (diff)
Merge branch 'ab/plug-revisions-leak'
Plug a bit more leaks in the revisions API. * ab/plug-revisions-leak: revisions API: don't leak memory on argv elements that need free()-ing bisect.c: partially fix bisect_rev_setup() memory leak log: refactor "rev.pending" code in cmd_show() log: fix a memory leak in "git show <revision>..." test-fast-rebase helper: use release_revisions() (again) bisect.c: add missing "goto" for release_revisions()
Diffstat (limited to 'remote.c')
-rw-r--r--remote.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/remote.c b/remote.c
index e90dca1d56..618ad5a0f1 100644
--- a/remote.c
+++ b/remote.c
@@ -2147,6 +2147,9 @@ static int stat_branch_pair(const char *branch_name, const char *base,
struct object_id oid;
struct commit *ours, *theirs;
struct rev_info revs;
+ struct setup_revision_opt opt = {
+ .free_removed_argv_elements = 1,
+ };
struct strvec argv = STRVEC_INIT;
/* Cannot stat if what we used to build on no longer exists */
@@ -2181,7 +2184,7 @@ static int stat_branch_pair(const char *branch_name, const char *base,
strvec_push(&argv, "--");
repo_init_revisions(the_repository, &revs, NULL);
- setup_revisions(argv.nr, argv.v, &revs, NULL);
+ setup_revisions(argv.nr, argv.v, &revs, &opt);
if (prepare_revision_walk(&revs))
die(_("revision walk setup failed"));