No, it's handled for you automatically. That is, the top-most
TVBUFF_REAL_DATA
that is created in dissect_packet() (the top-most dissector) is freed via
tvb_free_chain(),
and all tvbuffs created from it or its progeny are freed too. So the entire
chain of
TVBUFF_SUBSETs that are created from one another, ultimately proceeding
from the
initial TVBUFF_REAL_DATA, are freed.
It's more complicated than that... reference counts of usage (within a
tvbuff chain) are
kept because TVBUFF_COMPOSITEs can't be freed until all tvbuff's that they
use are
freed. But Ethereal does't use the TVBUFF_COMPOSITE type yet.
--gilbert
Mark Atwood <mra@xxxxxxxxx> on 11/08/2000 04:35:22 PM
To: ethereal-dev@xxxxxxxxxxxx
cc: (bcc: Gilbert Ramirez/Tivoli Systems)
Subject: [Ethereal-dev] Do I have to free tvbuff's?
I'm porting my dissector over to tvbuffs. Do I have to free a tvbuff
before it goes out of scope?
I first dissect the header, adn then do something like the following
to dissect the payload..
/* dissect a single payload */
{
tvbuff_t *payload_tvb;
payload_tvb
= tvb_new_subset(tvb, header_size), -1,
sizeof_payloadpart(peeled_iquery_header.type));
dissect_my_payload(payload_type,
payload_tvb,
tree_my_payload);
}
_______________________________________________
Ethereal-dev mailing list
Ethereal-dev@xxxxxxxxxxxx
http://www.ethereal.com/mailman/listinfo/ethereal-dev