]> git.ipfire.org Git - thirdparty/git.git/commit
sequencer: fix memory leak if `todo_list_rearrange_squash()` failed
authorLidong Yan <502024330056@smail.nju.edu.cn>
Wed, 14 May 2025 13:53:28 +0000 (13:53 +0000)
committerJunio C Hamano <gitster@pobox.com>
Thu, 15 May 2025 20:53:33 +0000 (13:53 -0700)
commit044511f889b1989840339a322f84e50dfa3bf6e0
tree34d2338fa838dceda15b0ea5047fd97cb93df541
parent1a8a4971cc6c179c4dd711f4a7f5d7178f4b3ab7
sequencer: fix memory leak if `todo_list_rearrange_squash()` failed

In sequencer.c:todo_list_rearrange_squash, if it fails, memory
allocated in `next`, `tail`, `subjects` and `subject2item` will leak.
Jump to cleanup label before return could fix this leak problem.

Signed-off-by: Lidong Yan <502024330056@smail.nju.edu.cn>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
sequencer.c