diff options
author | Guy Harris <guy@alum.mit.edu> | 2001-03-15 22:08:41 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2001-03-15 22:08:41 +0000 |
commit | 022cfcf826330fc0d8ab811e01a02ff900a3c22a (patch) | |
tree | 9597ac87f2b491bcc09a45fff1fa3f6fc249dfb1 /epan | |
parent | 39e3ee9600d84b0ea46a1941242c54fc8533c7c2 (diff) |
The other "proto_tree_add" routines will, if the "tree" argument is
null, just return NULL without doing any work; make
"proto_tree_add_item()" do so as well.
svn path=/trunk/; revision=3139
Diffstat (limited to 'epan')
-rw-r--r-- | epan/proto.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/epan/proto.c b/epan/proto.c index 085821bbc0..0f54f2c528 100644 --- a/epan/proto.c +++ b/epan/proto.c @@ -1,7 +1,7 @@ /* proto.c * Routines for protocol tree * - * $Id: proto.c,v 1.13 2001/03/07 19:33:22 gram Exp $ + * $Id: proto.c,v 1.14 2001/03/15 22:08:41 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@zing.org> @@ -445,6 +445,9 @@ proto_tree_add_item(proto_tree *tree, int hfindex, tvbuff_t *tvb, char *string; int found_length; + if (!tree) + return(NULL); + new_fi = alloc_field_info(hfindex, tvb, start, length); if (new_fi == NULL) |