aboutsummaryrefslogtreecommitdiffstats
path: root/tethereal.c
diff options
context:
space:
mode:
authorRonnie Sahlberg <ronnie_sahlberg@ozemail.com.au>2005-07-22 07:46:58 +0000
committerRonnie Sahlberg <ronnie_sahlberg@ozemail.com.au>2005-07-22 07:46:58 +0000
commitc841beb71b9fb3b0dca979ed3ae7c6b578a80b6f (patch)
tree15ee9511e300d661e303aef5fa85911ed5c1ef5e /tethereal.c
parent762fc4f4ebe09692c449aa521df1d14ebadc5709 (diff)
EMEM : a simple and FAST api to allocate memory that will be automatically freed() when the next packet is dissected.
This offesr memory allocation with a packet scope making memory leaks less likely and memory management faster. Add initialization calls for both tethereal and ethereal. Convert the ip_to_str() function to use this and avoid doing the silly rotating buffers thing it previously did. We also need an equivalent set of functions for allocation with capture file scope (free when next capture is loaded) but i dont know where to put the free_all call. svn path=/trunk/; revision=14984
Diffstat (limited to 'tethereal.c')
-rw-r--r--tethereal.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/tethereal.c b/tethereal.c
index 4bedfabfb0..5e499deb3a 100644
--- a/tethereal.c
+++ b/tethereal.c
@@ -103,7 +103,7 @@
#endif /* _WIN32 */
#include "capture.h"
#endif /* HAVE_LIBPCAP */
-
+#include "epan/emem.h"
/*
* This is the template for the decode as option; it is shared between the
@@ -654,6 +654,9 @@ main(int argc, char *argv[])
dfilter_t *rfcode = NULL;
e_prefs *prefs;
char badopt;
+
+ /* initialize memory allocation subsystem */
+ ep_init_chunk();
#ifdef HAVE_LIBPCAP
capture_opts_init(&capture_opts, NULL /* cfile */);