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:
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>2022-04-13 23:01:41 +0300
committerJunio C Hamano <gitster@pobox.com>2022-04-14 09:56:09 +0300
commitb78ce337def2db3a6fceee157f49202e5d1ce46a (patch)
tree9851e1b86c6e54109340b2c823778a5b39a1b304 /http-push.c
parent0139c58ab951e8620d6066eb687d0a96e490436a (diff)
revisions API users: use release_revisions() in http-push.c
In the case of cmd_main() in http-push.c we need to move the deceleration of the "struct rev-list" into the loop over the "remote_refs" when adding a release_revisions(). We'd previously set up the "revs" for each remote, but would potentially leak memory on each one. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'http-push.c')
-rw-r--r--http-push.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/http-push.c b/http-push.c
index f0c044dcf7..01e7c2ac5c 100644
--- a/http-push.c
+++ b/http-push.c
@@ -1689,7 +1689,6 @@ int cmd_main(int argc, const char **argv)
struct refspec rs = REFSPEC_INIT_PUSH;
struct remote_lock *ref_lock = NULL;
struct remote_lock *info_ref_lock = NULL;
- struct rev_info revs;
int delete_branch = 0;
int force_delete = 0;
int objects_to_send;
@@ -1825,6 +1824,7 @@ int cmd_main(int argc, const char **argv)
new_refs = 0;
for (ref = remote_refs; ref; ref = ref->next) {
+ struct rev_info revs;
struct strvec commit_argv = STRVEC_INIT;
if (!ref->peer_ref)
@@ -1941,6 +1941,7 @@ int cmd_main(int argc, const char **argv)
unlock_remote(ref_lock);
check_locks();
strvec_clear(&commit_argv);
+ release_revisions(&revs);
}
/* Update remote server info if appropriate */