Ethereal-dev: RE: [Ethereal-dev] proto_tree_append_string() - now fixed

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

From: Biot Olivier <Olivier.Biot@xxxxxxxxxxx>
Date: Tue, 28 Oct 2003 14:59:03 +0100
Hi Folks,

I figured out that there was no function yet that only frees the value part
alone (indeed fvalue_free() frees the entire structure, not only the value
contained within it), so I added this function to epan/ftypes/ftypes.[ch] as
fvalue_free_value(). This new patch then implements a non-leaking
proto_tree_append_string() function in epan/proto.[ch].

Please review and check in.

Regards,

Olivier

| -----Original Message-----
| From: Guy Harris [mailto:guy@xxxxxxxxxxxx] 
| Sent: dinsdag 28 oktober 2003 0:50
| To: Gilbert Ramirez
| Cc: Biot Olivier; Ethereal Development
| Subject: Re: [Ethereal-dev] Patch epan/proto.c - 
| proto_tree_append_string( )
| 
| 
| 
| On Oct 27, 2003, at 12:49 PM, Gilbert Ramirez wrote:
| 
| > Note the fvalue_free() frees the memory used by the 
| fvalue_t structure,
| > so the fvalue_set() immediately after fvalue_free() is writing to
| > deallocated memory.
| 
| ...and fvalue_set() without fvalue_free() leaks memory, as the old 
| string isn't freed.
| 
| Should string_fvalue_set() free fv->value.string if it's non-null?
| 

Attachment: epan_proto.diff
Description: Binary data