Re: [PATCH 07/21] pretty: clear signature check
- From
Toon Claes <toon@iotcl.com>
- Date
- Oct 18, 2024, 12:02 UTC
- Message-ID
- <87a5f1d3fb.fsf@iotcl.com>
- In-Reply-To
- <5d5f6867f918460001f62aaa78f24cf3cbe53a3c.1728624670.git.ps@pks.im>
Patrick Steinhardt <ps@pks.im> writes:
Show 21 quoted lines
> The signature check in of the formatting context is never getting > released. Fix this to plug the resulting memory leak. > > Signed-off-by: Patrick Steinhardt <ps@pks.im> > --- > pretty.c | 1 + > t/t4202-log.sh | 1 + > t/t7031-verify-tag-signed-ssh.sh | 1 + > t/t7510-signed-commit.sh | 1 + > t/t7528-signed-commit-ssh.sh | 1 + > 5 files changed, 5 insertions(+) > > diff --git a/pretty.c b/pretty.c > index 6403e268900..098378720a4 100644 > --- a/pretty.c > +++ b/pretty.c > @@ -2032,6 +2032,7 @@ void repo_format_commit_message(struct repository *r, > > free(context.commit_encoding); > repo_unuse_commit_buffer(r, commit, context.message); > + signature_check_clear(&context.signature_check);
I was having a very hard time finding where this gets allocated, and to be honest, I still don't know for sure. I think in check_commit_signature() which is called by format_commit_one(). In "[PATCH 20/21] builtin/merge: release outbut buffer after performing merge" you mention it's not obvious to the caller they need know about memory they need to clean up, isn't that case here as well?
-- Toon