Clean-up hash table at reloading of file.
authoretxrab <etxrab@f5534014-38df-0310-8fa8-9805f1628bb7>
Sun, 21 Nov 2004 22:26:53 +0000 (22:26 +0000)
committeretxrab <etxrab@f5534014-38df-0310-8fa8-9805f1628bb7>
Sun, 21 Nov 2004 22:26:53 +0000 (22:26 +0000)
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@12568 f5534014-38df-0310-8fa8-9805f1628bb7

epan/sigcomp_state_hdlr.c

index c7b729fe1c82fdf71e9b139c48a7454ed3de4229..4b97411a37206c1340491ec9c4985f4911d58ded 100644 (file)
@@ -374,6 +374,15 @@ static const guint8 sip_sdp_static_dictionaty_for_sigcomp[0x12e4] =
 
 }; 
 static GHashTable *state_buffer_table=NULL;
+\r
+static void\r
+state_buffer_table_cleanup(gpointer key _U_, gpointer value, gpointer user_data _U_){\r
+\r
+       guint8 *state_buff = value;\r
+\r
+       if ( state_buff )\r
+               g_free(state_buff);\r
+}\r
 
 void
 sigcomp_init_udvm(void){
@@ -381,6 +390,10 @@ sigcomp_init_udvm(void){
        gchar *partial_state_str;
        guint i;
        guint8 *sip_sdp_buff;
+\r
+       /* Destroy any existing memory chunks / hashes. */\r
+       if (state_buffer_table)\r
+               g_hash_table_foreach(state_buffer_table, state_buffer_table_cleanup, NULL);\r
        
 
        state_buffer_table = g_hash_table_new(g_str_hash, g_str_equal);