avoid freeing the gop_key more than once and do not reregister the tap at every reload
authorlego <lego@f5534014-38df-0310-8fa8-9805f1628bb7>
Fri, 11 Feb 2005 00:04:25 +0000 (00:04 +0000)
committerlego <lego@f5534014-38df-0310-8fa8-9805f1628bb7>
Fri, 11 Feb 2005 00:04:25 +0000 (00:04 +0000)
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@13382 f5534014-38df-0310-8fa8-9805f1628bb7

plugins/mate/mate_runtime.c
plugins/mate/packet-mate.c

index e13e32232342777cd5ce4c74930d7a56db4c9431..dc44a9f2905ba90853aa49a05bc047149de1bd2c 100644 (file)
@@ -525,6 +525,7 @@ static void analize_pdu(mate_pdu* pdu) {
                                if ( gop->released ) {
                                        dbg_print (dbg_gop,3,dbg_facility,"analize_pdu: start on released gop, a new gop");
                                        g_hash_table_remove(cfg->gop_index,gop_key);
+                                       gop->gop_key = NULL;
                                        gop = new_gop(cfg,pdu,gop_key);
                                        g_hash_table_insert(cfg->gop_index,gop_key,gop);
                                } else {
index 45be5b5c80125eb158954ce53fb3e1e6ef525856..9956738da8c5fe164591752409f6dd33a4e5ba81 100644 (file)
@@ -246,11 +246,13 @@ static int mate_packet(void *prs _U_,  packet_info* tree _U_, epan_dissect_t *ed
 static void init_mate(void) {
        GString* tap_error = NULL;
 
-       tap_error = register_tap_listener("frame", &mate_tap_data,
-                                                                         (char*) mc->tap_filter,
-                                                                         (tap_reset_cb) NULL,
-                                                                         mate_packet,
-                                                                         (tap_draw_cb) NULL);
+       if ( ! mate_tap_data ) {
+               tap_error = register_tap_listener("frame", &mate_tap_data,
+                                                                                 (char*) mc->tap_filter,
+                                                                                 (tap_reset_cb) NULL,
+                                                                                 mate_packet,
+                                                                                 (tap_draw_cb) NULL);
+       }
        
        if ( tap_error ) {
                g_warning("mate: couldn't (re)register tap: %s",tap_error->str);