Wireshark-dev: [Wireshark-dev] Re: g_new0() allocation in init_iousers()

Date Prev · Date Next · Thread Prev · Thread Next
From: Rustam Kovhaev <rkovhaev@xxxxxxxxx>
Date: Sat, 14 Jun 2025 13:24:09 -0700
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.