Re: [PATCH] protocol-caps.c: fix memory leak in send_info()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Aug 31 2021, Bruno Albuquerque wrote:

> On Tue, Aug 31, 2021 at 6:46 AM Ævar Arnfjörð Bjarmason <avarab@xxxxxxxxx> wrote:
>
>  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 packet_writer_write(), 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).
>
>  This makes t5701-git-serve.sh pass again under SANITIZE=leak, as it
>  did before a2ba162cda2.
>
> Thanks for cleaning up after me. Yes, this was my lack of knowledge on how the internals of Git works. I was also not aware of SANITIZE=leak so thanks for
> the heads up. This looks good to me.

Thanks, for what it's worth the series I submitted in parallel to this
to add a SANITIZE=leak CI mode at
https://lore.kernel.org/git/cover-v3-0.8-00000000000-20210831T132546Z-avarab@xxxxxxxxx
could use reviewers :)

I.e. having some real tests for this sort of thing and running them in
CI will help to catch any such issues earlier.




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux