Re: [PATCH] revision: fix memory leak in prepare_show_merge()
- From
Patrick Steinhardt <ps@pks.im>
- Date
- Jun 4, 2025, 07:48 UTC
- Message-ID
- <aD_6T0lUOsqrb5sH@pks.im>
- In-Reply-To
- <pull.1989.git.git.1749006537271.gitgitgadget@gmail.com>
On Wed, Jun 04, 2025 at 03:08:56AM +0000, Lidong Yan via GitGitGadget wrote:
Show 5 quoted lines
> From: Lidong Yan <502024330056@smail.nju.edu.cn> > > In revision.c:prepare_show_merge(), we allocated an array in prune > but forget to free it. Since parse_pathspec is not responsible to > free prune, we should add `free(prune)` in the end of prepare_show_merge().
That is a rather obvious memory leak indeed. Do you know why we never detected the leak in our CI? Is this code path not exercised at all by our tests?
Patrick