]> git.ipfire.org Git - thirdparty/git.git/commit
revision: fix memory leak when reversing revisions
authorPatrick Steinhardt <ps@pks.im>
Tue, 11 Jun 2024 09:19:17 +0000 (11:19 +0200)
committerJunio C Hamano <gitster@pobox.com>
Tue, 11 Jun 2024 20:15:04 +0000 (13:15 -0700)
commit56931c4d89e7efe41dd96d230b8176e2d32a035d
tree9b962b62bef2de8f4deaa61150668b082101ea14
parent03b0e7d3a72a4a9be97b742fc3119ebb70ed9731
revision: fix memory leak when reversing revisions

When reversing revisions in a rev walk, `get_revision()` will allocate a
new commit list and assign it to `revs->commits`. It does not free the
old list though, which makes it leak. Fix this.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
revision.c
t/t3508-cherry-pick-many-commits.sh