aboutsummaryrefslogtreecommitdiffstats
path: root/file.c
diff options
context:
space:
mode:
authorguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>2001-05-27 21:33:16 +0000
committerguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>2001-05-27 21:33:16 +0000
commit414edbb8112b946d6dc10e3047226b59bc779b26 (patch)
treec962dea7793a1f58e59abacac532d363802ca3d8 /file.c
parent60c85171f271c7ff9e61594e752facf15e5957d8 (diff)
Plug a memory leak (we weren't freeing the "epan_dissect_t" pointed to
by the "edt" member of a "capture_file" structure if we were selecting a new frame, we were just overwriting that pointer). Update Gerald's e-mail address. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@3470 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'file.c')
-rw-r--r--file.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/file.c b/file.c
index 06d10c938b..9e506d8d5e 100644
--- a/file.c
+++ b/file.c
@@ -1,10 +1,10 @@
/* file.c
* File I/O routines
*
- * $Id: file.c,v 1.236 2001/05/01 00:18:46 guy Exp $
+ * $Id: file.c,v 1.237 2001/05/27 21:33:16 guy Exp $
*
* Ethereal - Network traffic analyzer
- * By Gerald Combs <gerald@zing.org>
+ * By Gerald Combs <gerald@ethereal.com>
* Copyright 1998 Gerald Combs
*
*
@@ -1586,6 +1586,10 @@ select_packet(capture_file *cf, int row)
proto_tree_free(cf->protocol_tree);
cf->protocol_tree = proto_tree_create_root();
proto_tree_is_visible = TRUE;
+ if (cf->edt != NULL) {
+ epan_dissect_free(cf->edt);
+ cf->edt = NULL;
+ }
cf->edt = epan_dissect_new(&cf->pseudo_header, cf->pd, cf->current_frame,
cf->protocol_tree);
proto_tree_is_visible = FALSE;
@@ -1610,11 +1614,14 @@ select_packet(capture_file *cf, int row)
void
unselect_packet(capture_file *cf)
{
- /* Destroy the protocol tree for that packet. */
+ /* Destroy the protocol tree and epan_dissect_t for that packet. */
if (cf->protocol_tree != NULL) {
proto_tree_free(cf->protocol_tree);
cf->protocol_tree = NULL;
+ }
+ if (cf->edt != NULL) {
epan_dissect_free(cf->edt);
+ cf->edt = NULL;
}
finfo_selected = NULL;