Ethereal-dev: Re: [Ethereal-dev] Proposal for mew memory allocation API

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

From: ronnie sahlberg <ronniesahlberg@xxxxxxxxx>
Date: Wed, 6 Jul 2005 15:42:31 +1000
I have made suggested changes and also made it actually work  and not
leak mem like there is no tomorrow (as the initial api example did).

I would want to wait until after the next release before pushing it in.


The natural place to put the call to the
free_all_mem_allocated_with_packet_lifetime() would
be at the start of dissect packet(), cleaning up/freeing all
allocations _before_ starting to dissect the current packet.


But where to hook in the free_all_mem_with_capture_file_lifetime()  ?



On 7/6/05, Guy Harris <gharris@xxxxxxxxx> wrote:
> didier wrote:
> 
> > BTW there's a bug in packet-eth.c around line 300
> >  ti = proto_tree_add_protocol_format(parent_tree, proto_eth, tvb, 0,
> > ETH_HEADER_SIZE,
> >
> > Without Mac resolution get_ether_name *is* ether_to_str so it pushes
> > four ether_to_str results but there's only 3 buffers...
> 
> The real problem is that it pushes four ether_to_str results - if name
> resolution is off, things such as
> 
>         Source address: 172.20.4.17 (172.20.4.17)
> 
> or
> 
>         Destination: 00:0c:0a:fb:20:21 (00:0c:0a:fb:20:21)
> 
> are written, but I suspect one copy of the address is enough:
> 
>         Source address: 172.20.4.17
> 
>         Destination: 00:0c:0a:fb:20:21
> 
> and the like.
>