Re: [PATCH v2 3/4] SANITIZE tests: fix memory leaks in t5701*, add to whitelist
- From
Jeff King <peff@peff.net>
- Date
- Jul 15, 2021, 21:43 UTC
- Message-ID
- <YPCsDLoiiAG/C/ft@coredump.intra.peff.net>
- In-Reply-To
- <patch-3.4-b7fb5d5a56-20210714T172251Z-avarab@gmail.com>
On Wed, Jul 14, 2021 at 07:23:53PM +0200, Ævar Arnfjörð Bjarmason wrote:
Show 8 quoted lines
> Fix a memory leak in a2ba162cda (object-info: support for retrieving > object info, 2021-04-20) which appears to have been based on a > misunderstanding of how the pkt-line.c API works, there is no need to > strdup() input to, it's just a printf()-like format function. > > This fixes a potentially large memory leak, since the number of OID > lines the "object-info" call can be arbitrarily large (or a small one > if the request is small).
Very nice. This will also be much more efficient, since we get to reuse the same buffer in each run through the loop.
-Peff