aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2002-02-25 21:02:10 +0000
committerGuy Harris <guy@alum.mit.edu>2002-02-25 21:02:10 +0000
commit0a861db40b91ad064dfe9efc27875c9f76dadb0c (patch)
tree76e4c9f02ada157506e5ba68df8aa2ba0471e665
parent98d338601903400cd452762a59544efde2027cea (diff)
downloadwireshark-0a861db40b91ad064dfe9efc27875c9f76dadb0c.tar.gz
wireshark-0a861db40b91ad064dfe9efc27875c9f76dadb0c.tar.bz2
wireshark-0a861db40b91ad064dfe9efc27875c9f76dadb0c.zip
Note that we could save some overhead if we require the name argument to
"add_new_data_source()" to be a string constant (or some other static data item). svn path=/trunk/; revision=4803
-rw-r--r--epan/packet.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/epan/packet.c b/epan/packet.c
index 7efceae46d..0e3b766d51 100644
--- a/epan/packet.c
+++ b/epan/packet.c
@@ -1,7 +1,7 @@
/* packet.c
* Routines for packet disassembly
*
- * $Id: packet.c,v 1.61 2002/02/24 06:45:14 guy Exp $
+ * $Id: packet.c,v 1.62 2002/02/25 21:02:10 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -210,6 +210,11 @@ add_new_data_source(frame_data *fd, tvbuff_t *tvb, char *name)
}
src = g_mem_chunk_alloc(data_source_chunk);
src->tvb = tvb;
+ /*
+ * XXX - if we require this argument to be a string constant,
+ * we don't need to allocate a buffer for a copy and make a
+ * copy, and wouldn't need to free the buffer, either.
+ */
src->name = g_strdup(name);
fd->data_src = g_slist_append(fd->data_src, src);
}