aboutsummaryrefslogtreecommitdiffstats
path: root/file.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2000-04-04 05:14:48 +0000
committerGuy Harris <guy@alum.mit.edu>2000-04-04 05:14:48 +0000
commit05fe159e74f1bcaa3f2dc9e60846bd3022483279 (patch)
tree8411c440ff5e8de7c1300194b84b544914dce038 /file.c
parent6dd3208cfc5e4def9b35cca99b46d7520d199bff (diff)
Allocate the new mem chunk for the capture in "open_cap_file()", rather
than duplicating the allocation code in "read_cap_file()" and "start_tail_cap_file()". svn path=/trunk/; revision=1784
Diffstat (limited to 'file.c')
-rw-r--r--file.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/file.c b/file.c
index 562089f806..6ebd815cc3 100644
--- a/file.c
+++ b/file.c
@@ -1,7 +1,7 @@
/* file.c
* File I/O routines
*
- * $Id: file.c,v 1.177 2000/04/03 22:28:51 gram Exp $
+ * $Id: file.c,v 1.178 2000/04/04 05:14:48 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@@ -169,6 +169,11 @@ open_cap_file(char *fname, gboolean is_tempfile, capture_file *cf)
firstsec = 0, firstusec = 0;
prevsec = 0, prevusec = 0;
+ cf->plist_chunk = g_mem_chunk_new("frame_data_chunk",
+ sizeof(frame_data),
+ FRAME_DATA_CHUNK_SIZE * sizeof(frame_data),
+ G_ALLOC_AND_FREE);
+
return (0);
fail:
@@ -304,10 +309,6 @@ read_cap_file(capture_file *cf)
freeze_clist(cf);
proto_tree_is_visible = FALSE;
- cf->plist_chunk = g_mem_chunk_new("frame_data_chunk",
- sizeof(frame_data),
- FRAME_DATA_CHUNK_SIZE * sizeof(frame_data),
- G_ALLOC_AND_FREE);
success = wtap_loop(cf->wth, 0, wtap_dispatch_cb, (u_char *) cf, &err);
/* Set the file encapsulation type now; we don't know what it is until
we've looked at all the packets, as we don't know until then whether
@@ -385,10 +386,6 @@ start_tail_cap_file(char *fname, gboolean is_tempfile, capture_file *cf)
int i;
err = open_cap_file(fname, is_tempfile, cf);
- cf->plist_chunk = g_mem_chunk_new("frame_data_chunk",
- sizeof(frame_data),
- FRAME_DATA_CHUNK_SIZE * sizeof(frame_data),
- G_ALLOC_AND_FREE);
if (err == 0) {
/* Disable menu items that make no sense if you're currently running
a capture. */