Huge thanks to our Platinum Members Endace and LiveAction,
and our Silver Member Veeam, for supporting the Wireshark Foundation and project.

Wireshark-dev: Re: [Wireshark-dev] RFD: Limiting scope of ep_ memory

From: Jakub Zawadzki <darkjames-ws@xxxxxxxxxxxx>
Date: Mon, 22 Oct 2012 19:45:14 +0200
On Mon, Oct 22, 2012 at 12:43:49PM -0400, Evan Huus wrote:
> On Mon, Oct 22, 2012 at 12:21 PM, Anders Broman
> > - My feeling is that mixing ep and g_malloced memory in pinfo is a bad idea.
> 
> Yes. Perhaps pinfo should have its own scope that is between ep and
> se? This would be much easier given the changes suggested in [1].

Looking at packet_info structure only sccp_info[1] is ep allocated,
but it's safe, cause only used when dissecting packet.

... and sometimes address->data is pointed to ep_ pool.

Generally it's simillar case like with col_set_str(ep_memory_pool).
This one is checked with ep_verify_pointer.

So before ep_free_all():
  DISSECTOR_ASSERT(!ep_verify_pointer(edt->pi.src.data));
  DISSECTOR_ASSERT(!ep_verify_pointer(edt->pi.dst.data));
  DISSECTOR_ASSERT(!ep_verify_pointer(edt->pi.net_src.data));
  DISSECTOR_ASSERT(!ep_verify_pointer(edt->pi.net_dst.data));
  /* ... */
  ?