avoid freeing the gop_key more than once and do not reregister the tap at every reload

svn path=/trunk/; revision=13382
This commit is contained in:
Luis Ontanon 2005-02-11 00:04:25 +00:00
parent 24b8161e82
commit f152359ac3
2 changed files with 8 additions and 5 deletions

View 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 {

View 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);