aboutsummaryrefslogtreecommitdiffstats
path: root/epan/stats_tree.c
diff options
context:
space:
mode:
authorlego <lego@f5534014-38df-0310-8fa8-9805f1628bb7>2005-02-27 16:55:24 +0000
committerlego <lego@f5534014-38df-0310-8fa8-9805f1628bb7>2005-02-27 16:55:24 +0000
commit79fd23e8c7c5cf34fc97237be434278dba58aa15 (patch)
tree10e8a934441d70617b5b64fd760887800706176f /epan/stats_tree.c
parent68e1040a4b2a74e3d9cf2467905db69997eca6b9 (diff)
Several fixes to the stats_tree
- Avoid creating a copy of every branch at reinitialization this used to cause some GTK warnings and a leakage of tree nodes - propperly check the optarg to avoid getting junk in the filter text this caused a crash git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@13534 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'epan/stats_tree.c')
-rw-r--r--epan/stats_tree.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/epan/stats_tree.c b/epan/stats_tree.c
index 24f8df2df1..885b300a20 100644
--- a/epan/stats_tree.c
+++ b/epan/stats_tree.c
@@ -153,6 +153,7 @@ static void free_stat_node( stat_node* node ) {
if(node->st->free_node_pr) node->st->free_node_pr(node);
if (node->hash) g_hash_table_destroy(node->hash);
+
if (node->rng) g_free(node->rng);
if (node->name) g_free(node->name);
@@ -213,6 +214,9 @@ extern void reinit_stats_tree(void* p) {
free_stat_node(child);
}
+ st->root.children = NULL;
+ st->root.counter = 0;
+
if (st->init) {
st->init(st);
}
@@ -364,7 +368,8 @@ static stat_node* new_stat_node(stats_tree* st,
node->st = (stats_tree*) st;
node->hash = with_hash ? g_hash_table_new(g_str_hash,g_str_equal) : NULL;
node->parent = NULL;
-
+ node->rng = NULL;
+
if (as_parent_node) {
g_hash_table_insert(st->names,
node->name,