Free the string you "g_strdup()"ed, rather than handing "g_free()" the
[obnox/wireshark/wip.git] / packet-osi-options.c
index 02b089cd65b280c5f3cf37540d5b4ef28608a978..5a16a69afef406d15b5d8ad8cb7f8d32c38717c0 100644 (file)
@@ -5,7 +5,7 @@
  * ISO 10589 ISIS (Intradomain Routeing Information Exchange Protocol)
  * ISO  9542 ESIS (End System To Intermediate System Routeing Exchange Protocol)
  *
- * $Id: packet-osi-options.c,v 1.5 2001/02/05 02:47:31 guy Exp $
+ * $Id: packet-osi-options.c,v 1.7 2001/04/23 04:19:40 guy Exp $
  * Ralf Schneider <Ralf.Schneider@t-online.de>
  *
  * Ethereal - Network traffic analyzer
@@ -177,7 +177,7 @@ dissect_option_qos( const u_char type, const u_char sub_type, int offset,
   proto_tree *osi_qos_tree = NULL;
   
   
-  ti = proto_tree_add_text( tree, NullTVB, offset, len,
+  ti = proto_tree_add_text( tree, tvb, offset, len,
                             "Quality of service maintenance: %s",
                        val_to_str( type, osi_opt_qos_vals, "Unknown (0x%x)") );
   
@@ -187,37 +187,38 @@ dissect_option_qos( const u_char type, const u_char sub_type, int offset,
 
     tmp_type = sub_type & OSI_OPT_QOS_SUB_RSVD;
     if ( tmp_type ) {
-         proto_tree_add_text( osi_qos_tree, NullTVB, offset, len,
+         proto_tree_add_text( osi_qos_tree, tvb, offset, len,
          val_to_str( tmp_type, osi_opt_qos_sub_vals, "Unknown (0x%x)") );
     }
     tmp_type = sub_type & OSI_OPT_QOS_SUB_SEQ_VS_TRS;
     if ( tmp_type ) {
-         proto_tree_add_text( osi_qos_tree, NullTVB, offset, len,
+         proto_tree_add_text( osi_qos_tree, tvb, offset, len,
          val_to_str( tmp_type, osi_opt_qos_sub_vals, "Unknown (0x%x)") );
     }
     tmp_type = sub_type &OSI_OPT_QOS_SUB_CONG_EXPED;
     if ( tmp_type ) {
-         proto_tree_add_text( osi_qos_tree, NullTVB, offset, len,
+         proto_tree_add_text( osi_qos_tree, tvb, offset, len,
          val_to_str( tmp_type, osi_opt_qos_sub_vals, "Unknown (0x%x)") );
     }
     tmp_type = sub_type & OSI_OPT_QOS_SUB_TSD_VS_COST;
     
     if ( tmp_type ) {
-         proto_tree_add_text( osi_qos_tree, NullTVB, offset, len,
+         proto_tree_add_text( osi_qos_tree, tvb, offset, len,
          val_to_str( tmp_type, osi_opt_qos_sub_vals, "Unknown (0x%x)") );
     }
     tmp_type = sub_type & OSI_OPT_QOS_SUB_RESERR_TRS;
     if ( tmp_type ) {
-         proto_tree_add_text( osi_qos_tree, NullTVB, offset, len,
+         proto_tree_add_text( osi_qos_tree, tvb, offset, len,
          val_to_str( tmp_type, osi_opt_qos_sub_vals, "Unknown (0x%x)") );
     }
     tmp_type = sub_type & OSI_OPT_QOS_SUB_RESERR_COST;
     if ( tmp_type ) {
-         proto_tree_add_text( osi_qos_tree, NullTVB, offset, len,
+         proto_tree_add_text( osi_qos_tree, tvb, offset, len,
          val_to_str( tmp_type, osi_opt_qos_sub_vals, "Unknown (0x%x)") );
     }
   }
-};
+}
+
 void
 dissect_option_route( u_char parm_type, u_char offset, u_char parm_len, 
                       tvbuff_t *tvb, proto_tree *tree ) {
@@ -273,7 +274,7 @@ dissect_option_route( u_char parm_type, u_char offset, u_char parm_len,
                   print_nsap_net( tvb_get_ptr(tvb, this_hop + 1, netl), netl ) );
     this_hop += 1 + netl;
   }
-};
+}
 
 
 
@@ -328,7 +329,7 @@ dissect_option_rfd( const u_char error, const u_char field, u_char offset,
     proto_tree_add_text( tree, tvb, offset, len,
                          "Reason for discard: UNKNOWN Error Class" );
   } 
-};
+}
 
 /* ############################## Dissection Functions ###################### */
 
@@ -367,12 +368,6 @@ dissect_osi_options( u_char pdu_type, u_char opt_len, tvbuff_t *tvb,
        return;
      }
      
-     if ( opt_len > END_OF_FRAME ) {
-       proto_tree_add_text( tree, tvb, offset, END_OF_FRAME, 
-           "### Options go past the end of the captured data in this PDU ###" );
-       return;
-     }
-
      ti = proto_tree_add_text( tree, tvb, offset, opt_len,
                                "### Option Section ###" );
      osi_option_tree = proto_item_add_subtree( ti, ott_osi_options );
@@ -442,7 +437,7 @@ dissect_osi_options( u_char pdu_type, u_char opt_len, tvbuff_t *tvb,
         offset  += parm_len;
       }
    } 
-}; /* dissect-osi-options */
+} /* dissect-osi-options */
 
 
 /*
@@ -471,5 +466,4 @@ proto_register_osi_options(void) {
     &ott_osi_redirect,
   };
   proto_register_subtree_array( ott, array_length(ott));
-};
-                                                       
+}