Re: [PATCH] sequencer: fix memory leak if `todo_list_rearrange_squash()` failed
- From
lidongyan <502024330056@smail.nju.edu.cn>
- Date
- May 15, 2025, 10:45 UTC
- Message-ID
- <EEC15708-1EBA-45B7-BC79-980858634AE0@smail.nju.edu.cn>
- In-Reply-To
- <52e0a717-f7f0-401d-b621-f1f6e028e595@gmail.com>
2025/5/15 18:08,Phillip Wood <phillip.wood123@gmail.com> 写道:
Show 8 quoted lines
> > On 14/05/2025 14:53, Lidong Yan via GitGitGadget wrote: >> From: Lidong Yan <502024330056@smail.nju.edu.cn> >> 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. > > You could mention that you're adding the cleanup label.
Understood. I will pay attention to this in future patches.
> Out of interest how are you finding these leaks?
I am a graduate student at Nanjing University, working in collaboration with Professor [Qingkai Shi](https://qingkaishi.github.io/). We are currently developing a tool for statically analyzing memory leaks in C programs, and I am testing this tool on Git. To ensure the validity of our testing results, we are submitting patches to Git and seeking confirmation from you developers.