diff options
author | Evan Huus <eapache@gmail.com> | 2013-12-24 01:38:26 +0000 |
---|---|---|
committer | Evan Huus <eapache@gmail.com> | 2013-12-24 01:38:26 +0000 |
commit | 0ea5c80e1accdd471f86368d933e3776f00d0262 (patch) | |
tree | f80cd23e896c13930cd08f755102828b34f6bc55 | |
parent | edb6cf0b160ed7e9987f5f4c5894cc38a804807d (diff) | |
download | wireshark-0ea5c80e1accdd471f86368d933e3776f00d0262.tar.gz |
Replace an ep-stack with a wmem stack. Running epan_init() no longer uses
any ephemeral memory.
svn path=/trunk/; revision=54434
-rw-r--r-- | epan/dissectors/packet-dtls.c | 10 | ||||
-rw-r--r-- | epan/dissectors/packet-ssl-utils.c | 2 | ||||
-rw-r--r-- | epan/dissectors/packet-ssl.c | 10 |
3 files changed, 11 insertions, 11 deletions
diff --git a/epan/dissectors/packet-dtls.c b/epan/dissectors/packet-dtls.c index 49d6c43768..bedee5efca 100644 --- a/epan/dissectors/packet-dtls.c +++ b/epan/dissectors/packet-dtls.c @@ -271,8 +271,7 @@ dtls_init(void) static void dtls_parse_uat(void) { - ep_stack_t tmp_stack; - SslAssociation *tmp_assoc; + wmem_stack_t *tmp_stack; guint i; if (dtls_key_hash) @@ -282,11 +281,12 @@ dtls_parse_uat(void) } /* remove only associations created from key list */ - tmp_stack = ep_stack_new(); + tmp_stack = wmem_stack_new(NULL); g_tree_foreach(dtls_associations, ssl_assoc_from_key_list, tmp_stack); - while ((tmp_assoc = (SslAssociation *)ep_stack_pop(tmp_stack)) != NULL) { - ssl_association_remove(dtls_associations, tmp_assoc); + while (wmem_stack_count(tmp_stack) > 0) { + ssl_association_remove(dtls_associations, (SslAssociation *)wmem_stack_pop(tmp_stack)); } + wmem_destroy_stack(tmp_stack); /* parse private keys string, load available keys and put them in key hash*/ dtls_key_hash = g_hash_table_new(ssl_private_key_hash, ssl_private_key_equal); diff --git a/epan/dissectors/packet-ssl-utils.c b/epan/dissectors/packet-ssl-utils.c index 25476311eb..6d483fb5fe 100644 --- a/epan/dissectors/packet-ssl-utils.c +++ b/epan/dissectors/packet-ssl-utils.c @@ -3908,7 +3908,7 @@ gint ssl_assoc_from_key_list(gpointer key _U_, gpointer data, gpointer user_data) { if (((SslAssociation*)data)->from_key_list) - ep_stack_push((ep_stack_t)user_data, data); + wmem_stack_push((wmem_stack_t*)user_data, data); return FALSE; } diff --git a/epan/dissectors/packet-ssl.c b/epan/dissectors/packet-ssl.c index d3748e2b0f..5e1281aa1f 100644 --- a/epan/dissectors/packet-ssl.c +++ b/epan/dissectors/packet-ssl.c @@ -392,8 +392,7 @@ ssl_init(void) static void ssl_parse_uat(void) { - ep_stack_t tmp_stack; - SslAssociation *tmp_assoc; + wmem_stack_t *tmp_stack; guint i; ssl_set_debug(ssl_debug_file_name); @@ -405,11 +404,12 @@ ssl_parse_uat(void) } /* remove only associations created from key list */ - tmp_stack = ep_stack_new(); + tmp_stack = wmem_stack_new(NULL); g_tree_foreach(ssl_associations, ssl_assoc_from_key_list, tmp_stack); - while ((tmp_assoc = (SslAssociation *)ep_stack_pop(tmp_stack)) != NULL) { - ssl_association_remove(ssl_associations, tmp_assoc); + while (wmem_stack_count(tmp_stack) > 0) { + ssl_association_remove(ssl_associations, (SslAssociation *)wmem_stack_pop(tmp_stack)); } + wmem_destroy_stack(tmp_stack); /* parse private keys string, load available keys and put them in key hash*/ ssl_key_hash = g_hash_table_new(ssl_private_key_hash,ssl_private_key_equal); |