Text   |  XML   |  ReML   |   Visible Warnings:

Unused Value  at radius_dict.c:2772

No properties have been set. | edit properties
Jump to warning location ↓ warning details...
Show Events | Options

add_tlv

(/home/sate/Testcases/c/cve/wireshark-1.2.0/epan/radius_dict.c)expand/collapse
Show more  
 2770  void add_tlv(const gchar* name, const  gchar* codestr, radius_attr_dissector_t type, const gchar* current_attr) {
 2771          radius_attr_info_t* a;
 2772          radius_attr_info_t* s = g_malloc(sizeof(radius_attr_info_t));
 2773          guint32 code;
 2774   
 2775          a = g_hash_table_lookup(dict->attrs_by_name, current_attr);
 2776   
 2777          if (! a) {
 2778                  g_string_sprintfa(error, "Attr: '%s', does not exist in %s:%i \n", current_attr, fullpaths[include_stack_ptr], linenums[include_stack_ptr]);
 2779                  BEGIN JUNK;
 2780                  return;
 2781          }
 2782   
 2783          if (type == radius_tlv) {
 2784                  g_string_sprintfa(error, "sub-TLV: '%s', sub-TLV's type is specified as tlv in %s:%i \n", name, fullpaths[include_stack_ptr], linenums[include_stack_ptr]);
 2785                  BEGIN JUNK;
 2786                  return;
 2787          }
 2788   
 2789   
 2790          if (! a->tlvs_by_id) {
 2791                  a->tlvs_by_id = g_hash_table_new(g_direct_hash,g_direct_equal);
 2792          }
 2793   
 2794          code=strtol(codestr, NULL, 10);
 2795                   
 2796          s = g_hash_table_lookup(a->tlvs_by_id, GUINT_TO_POINTER(code));
 2797   
 2798          if (!s) {
 2799                  s = g_malloc(sizeof(radius_attr_info_t));
 2800                  s->name = NULL;
 2801                  s->dissector = NULL;
 2802          }
 2803   
 2804          s->code = code;
 2805          s->type = type;
 2806          s->encrypt = FALSE;
 2807          s->tagged = FALSE;
 2808          s->dissector = NULL;
 2809          s->vs = NULL;
 2810          s->hf = -1;
 2811          s->hf64 = -1;
 2812          s->hf_tag = -1;
 2813          s->hf_len = -1;
 2814          s->ett = -1;
 2815          s->tlvs_by_id = NULL;
 2816   
 2817          if (s->name)
 2818                  g_free((gpointer) s->name);
 2819          s->name = g_strdup(name);
 2820   
 2821          g_hash_table_insert(a->tlvs_by_id,GUINT_TO_POINTER(s->code),s);
 2822          g_hash_table_insert(dict->tlvs_by_name,(gpointer) (s->name),s);
 2823  }
Show more  




Change Warning 2914.29749 : Unused Value

Priority:
State:
Finding:
Owner:
Note: