From 590098604498f12e8d1700e05ca19acbc1548c25 Mon Sep 17 00:00:00 2001 From: Guy Harris Date: Tue, 28 Oct 2003 05:49:29 +0000 Subject: [PATCH] As per a suggestion by Olivier Biot, note that objects pointed to by pointer arguments to "proto_tree_add_XXX" functions are copied - if you allocated a buffer for one of them (e.g., a string), and you don't free that buffer when you're done with it, you'll leak memory. svn path=/trunk/; revision=8796 --- doc/README.developer | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/doc/README.developer b/doc/README.developer index ac045370a1..8f9add0065 100644 --- a/doc/README.developer +++ b/doc/README.developer @@ -1,4 +1,4 @@ -$Id: README.developer,v 1.82 2003/10/20 23:07:43 guy Exp $ +$Id: README.developer,v 1.83 2003/10/28 05:49:29 guy Exp $ This file is a HOWTO for Ethereal developers. It describes how to start coding a Ethereal protocol dissector and the use some of the important functions and @@ -235,7 +235,7 @@ code inside is needed only if you are using the "snprintf()" function. -The "$Id: README.developer,v 1.82 2003/10/20 23:07:43 guy Exp $" +The "$Id: README.developer,v 1.83 2003/10/28 05:49:29 guy Exp $" in the comment will be updated by CVS when the file is checked in; it will allow the RCS "ident" command to report which version of the file is currently checked out. @@ -245,7 +245,7 @@ version of the file is currently checked out. * Routines for PROTONAME dissection * Copyright 2000, YOUR_NAME * - * $Id: README.developer,v 1.82 2003/10/20 23:07:43 guy Exp $ + * $Id: README.developer,v 1.83 2003/10/28 05:49:29 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -1375,6 +1375,11 @@ These routines are used to add items to the protocol tree if either: The 'value' argument has the value to be added to the tree. +NOTE: in all cases where the argument is a pointer, a copy is made of +the object pointed to; if you have dynamically allocated a buffer for +the object, that buffer will not be freed when the protocol tree is +freed - you must free the buffer yourself when you don't need it any more. + For proto_tree_add_bytes(), the 'value_ptr' argument is a pointer to a sequence of bytes.