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: Guy Harris <guy@xxxxxxxxxxxx>
Date: Tue, 28 Oct 2003 12:39:31 -0800

On Oct 28, 2003, at 5:59 AM, Biot Olivier wrote:

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().

Is that the right answer, or is the right answer to have "fvalue_set" functions for values that are allocated free up the old value if there is one? You can do an "fvalue_set" on values that aren't allocated, such as integral values, even if an "fvalue_set" has already on that fvalue_t; why shouldn't that be allowed for values that are allocated?