> On 14 Jun 2025, at 22:24, Rustam Kovhaev <rkovhaev@xxxxxxxxx> wrote:
>
> On Sat, Jun 14, 2025 at 07:53:17PM +0200, Jaap Keuter wrote:
>>> On 14 Jun 2025, at 18:52, Rustam Kovhaev via Wireshark-dev <wireshark-dev@xxxxxxxxxxxxx> wrote:
>>>
>>> Hi,
>>> First of all, thank you for Wireshark! I am using it a lot, and I mean
>>> it, and I love it.
>>> Quick sanity check, we don't free g_new0() allocation in init_iousers(),
>>> do we?
>>> This is harmless, just something I noticed while reading the code.
>>> Thank you very much!
>> Hi,
>>
>> Unless there’s an error, no we don’t. Because it’s passed in register_tap_listener().
>>
>> Thanks,
>> Jaap
> Thanks for the quick reply!
> And that memory is allocated for the lifetime of the tshark process, and
> we don't explicitly free it, right?
> Because I don't see a matching g_free() call before tshark terminates.
HI,
That’s correct. We don’t care too much about freeing lifetime allocations, which cause more time/effort at process shutdown, where the OS can do a much better job at this.
It does shed some light on the register_tap_listener error paths though. They don’t seem consistent, potentially causing a double free.
Thanks,
Jaap