ANNOUNCEMENT: Live Wireshark University & Allegro Packets online APAC Wireshark Training Session
April 17th, 2024 | 14:30-16:00 SGT (UTC+8) | Online

Wireshark-dev: Re: [Wireshark-dev] allocating memory for hf_register_info

From: Joerg Mayer <jmayer@xxxxxxxxx>
Date: Wed, 9 Jan 2008 17:11:12 +0100
On Wed, Jan 09, 2008 at 05:03:07PM +0100, Luis EG Ontanon wrote:
> On Jan 9, 2008 10:09 AM, Richard Kümmel <R.Kuemmel@xxxxxxxxxxxx> wrote:
> > instead using
> >         static hf_register_info hf[]
> > i would like to create this array dynamically from and pass it to
> > proto_register_field_array.
> > I create this array from statically stored arrays of my own.
> > This worked fine. but when can i free this memory again. I did not find any
> > unregister function
> > callback to use.
> 
> As the data contained in the HF array has to persist for as long as
> the instance of wireshark is running there's no need to free such
> array, the OS itself will take care of release the memory (ad other
> resources used) as part of the process being terminated.

To explain that a bit more: There is no way to unregister an existing
dissector and thus there is no infrastructure to free resources used by
the registration process.

 ciao
    Joerg
-- 
Joerg Mayer                                           <jmayer@xxxxxxxxx>
We are stuck with technology when what we really want is just stuff that
works. Some say that should read Microsoft instead of technology.