summaryrefslogtreecommitdiff
path: root/epan/sigcomp_state_hdlr.c
diff options
context:
space:
mode:
authorAnders Broman <anders.broman@ericsson.com>2004-11-21 22:26:53 +0000
committerAnders Broman <anders.broman@ericsson.com>2004-11-21 22:26:53 +0000
commit010995250b185274e62636b76120ec26b984baea (patch)
tree455284ed52041a17011f5bbcb1ea69f1efd7ac0e /epan/sigcomp_state_hdlr.c
parent8ee46e00061bbc29ba47c1a6f6b45a11db633080 (diff)
downloadwireshark-010995250b185274e62636b76120ec26b984baea.tar.gz
Clean-up hash table at reloading of file.
svn path=/trunk/; revision=12568
Diffstat (limited to 'epan/sigcomp_state_hdlr.c')
-rw-r--r--epan/sigcomp_state_hdlr.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/epan/sigcomp_state_hdlr.c b/epan/sigcomp_state_hdlr.c
index c7b729fe1c..4b97411a37 100644
--- a/epan/sigcomp_state_hdlr.c
+++ b/epan/sigcomp_state_hdlr.c
@@ -374,6 +374,15 @@ static const guint8 sip_sdp_static_dictionaty_for_sigcomp[0x12e4] =
};
static GHashTable *state_buffer_table=NULL;
+
+static void
+state_buffer_table_cleanup(gpointer key _U_, gpointer value, gpointer user_data _U_){
+
+ guint8 *state_buff = value;
+
+ if ( state_buff )
+ g_free(state_buff);
+}
void
sigcomp_init_udvm(void){
@@ -381,6 +390,10 @@ sigcomp_init_udvm(void){
gchar *partial_state_str;
guint i;
guint8 *sip_sdp_buff;
+
+ /* Destroy any existing memory chunks / hashes. */
+ if (state_buffer_table)
+ g_hash_table_foreach(state_buffer_table, state_buffer_table_cleanup, NULL);
state_buffer_table = g_hash_table_new(g_str_hash, g_str_equal);