Re: [PATCH] pkt-line: re-'static'-ify buffer in packet_write_fmt_1()
- From
- Martin Ågren <martin.agren@gmail.com>
- Date
- Aug 27, 2017, 19:09 UTC
- Message-ID
- <CAN0heSraJFbbog7FKpAtmob9W6_5-AS1StZFVW6xUwMDWfMYgg@mail.gmail.com>
- In-Reply-To
- <9E4606AF-8814-42DE-8D3A-3A15C1B1723C@gmail.com>
On 27 August 2017 at 20:21, Lars Schneider <larsxschneider@gmail.com> wrote:
Show 11 quoted lines
>
>> On 27 Aug 2017, at 09:37, Martin Ågren <martin.agren@gmail.com> wrote:
>>
>> The static-ness was silently dropped in commit 70428d1a5 ("pkt-line: add
>> packet_write_fmt_gently()", 2016-10-16). As a result, for each call to
>> packet_write_fmt_1, we allocate and leak a buffer.
>
> Oh :-( Thanks for detecting and fixing the leak.
>
> How did you actually find it? Reading the code or did you use some
> tool?Valgrind found it for me. Most leaks it reports are "ok" since we're about to exit, it just takes more or less effort to realize that...
Martin