diff options
author | Guy Harris <guy@alum.mit.edu> | 2001-05-27 21:33:16 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2001-05-27 21:33:16 +0000 |
commit | e3a94e034282626b2e24157f6f00bdd39f029ba8 (patch) | |
tree | c962dea7793a1f58e59abacac532d363802ca3d8 /file.c | |
parent | ac655efe2f15382929acfe0772c2a39e760009a7 (diff) | |
download | wireshark-e3a94e034282626b2e24157f6f00bdd39f029ba8.tar.gz wireshark-e3a94e034282626b2e24157f6f00bdd39f029ba8.tar.bz2 wireshark-e3a94e034282626b2e24157f6f00bdd39f029ba8.zip |
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.
svn path=/trunk/; revision=3470
Diffstat (limited to 'file.c')
-rw-r--r-- | file.c | 13 |
1 files changed, 10 insertions, 3 deletions
@@ -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; |