Re: [PATCH] refs/files: prevent memory leak by freeing packed_ref_store
- From
Sven Strickroth <email@cs-ware.de>
- Date
- Aug 5, 2024, 09:45 UTC
- Message-ID
- <8953733a-7553-4514-8990-866947b54ae7@cs-ware.de>
- In-Reply-To
- <ZrCPBXql7ySbEeXG@tanuki>
Am 05.08.2024 um 10:36 schrieb Patrick Steinhardt:
> That does highlight that `packed_ref_store_init()` is misnamed and > really should be called `packed_ref_store_new()`, as it also allocates > the structure itself. But that's a #leftoverbit for another day, I'd > say.
This would also be true for ref for `files_ref_store_init` and `reftable_be_init`.
> Out of curiosity, did you hit this memory leak in some of our tests, or > did you just happen to stumble over it by chance?
I found this while working on TortoiseGit which also uses libgit internally.
-- Best regards, Sven Strickroth PGP key id F5A9D4C4 @ any key-server