aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2000-04-07 07:48:15 +0000
committerGuy Harris <guy@alum.mit.edu>2000-04-07 07:48:15 +0000
commit76f0935df955f63fbd0bb13fd47bb7ec55a5ce31 (patch)
tree7db6e445d805a3ec53b42b385e8d0a0290f73d9f
parentf20f651cd030d24941a686a292a4e165e8ad6ba2 (diff)
downloadwireshark-76f0935df955f63fbd0bb13fd47bb7ec55a5ce31.tar.gz
wireshark-76f0935df955f63fbd0bb13fd47bb7ec55a5ce31.tar.bz2
wireshark-76f0935df955f63fbd0bb13fd47bb7ec55a5ce31.zip
Plug a memory leak in the "Find Frame" code - we weren't freeing the
protocol tree after checking whether it matched the filter we supplied. svn path=/trunk/; revision=1814
-rw-r--r--file.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/file.c b/file.c
index 66c2d604fd..9c2e61a4f3 100644
--- a/file.c
+++ b/file.c
@@ -1,7 +1,7 @@
/* file.c
* File I/O routines
*
- * $Id: file.c,v 1.179 2000/04/06 06:04:24 guy Exp $
+ * $Id: file.c,v 1.180 2000/04/07 07:48:15 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@@ -1138,6 +1138,7 @@ find_packet(capture_file *cf, dfilter *sfcode)
guint32 progbar_nextstep;
int count;
proto_tree *protocol_tree;
+ gboolean frame_matched;
int row;
start_fd = cf->current_frame;
@@ -1207,7 +1208,9 @@ find_packet(capture_file *cf, dfilter *sfcode)
protocol_tree = proto_tree_create_root();
wtap_seek_read(cf->cd_t, cf->fh, fd->file_off, cf->pd, fd->cap_len);
dissect_packet(cf->pd, fd, protocol_tree);
- if (dfilter_apply(sfcode, protocol_tree, cf->pd)) {
+ frame_matched = dfilter_apply(sfcode, protocol_tree, cf->pd);
+ proto_tree_free(protocol_tree);
+ if (frame_matched) {
new_fd = fd;
break; /* found it! */
}