Skip to content

Commit b78ce33

Browse files
avargitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 0139c58 commit b78ce33

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

http-push.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1689,7 +1689,6 @@ int cmd_main(int argc, const char **argv)
16891689
struct refspec rs = REFSPEC_INIT_PUSH;
16901690
struct remote_lock *ref_lock = NULL;
16911691
struct remote_lock *info_ref_lock = NULL;
1692-
struct rev_info revs;
16931692
int delete_branch = 0;
16941693
int force_delete = 0;
16951694
int objects_to_send;
@@ -1825,6 +1824,7 @@ int cmd_main(int argc, const char **argv)
18251824

18261825
new_refs = 0;
18271826
for (ref = remote_refs; ref; ref = ref->next) {
1827+
struct rev_info revs;
18281828
struct strvec commit_argv = STRVEC_INIT;
18291829

18301830
if (!ref->peer_ref)
@@ -1941,6 +1941,7 @@ int cmd_main(int argc, const char **argv)
19411941
unlock_remote(ref_lock);
19421942
check_locks();
19431943
strvec_clear(&commit_argv);
1944+
release_revisions(&revs);
19441945
}
19451946

19461947
/* Update remote server info if appropriate */

0 commit comments

Comments
 (0)