Text   |  XML   |  ReML   |   Visible Warnings:

Useless Assignment  at tap-camelsrt.c:222

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

camelsrt_init

(/home/sate/Testcases/c/cve/wireshark-1.2.0/tap-camelsrt.c)expand/collapse
Show more  
 211  static void camelsrt_init(const char *optarg, void* userdata _U_)
 212  {
 213    struct camelsrt_t *p_camelsrt;
 214    const char *filter=NULL;
 215    const char *emptyfilter="";  
 216   
 217    GString *error_string;
 218   
 219    if(!strncmp(optarg,"camel,srt,",9)){
 220      filter=optarg+9;
 221    } else {
 222      filter=NULL;
 223    }
 224   
 225    p_camelsrt = g_malloc(sizeof(struct camelsrt_t));
 226    if(filter){
 227      p_camelsrt->filter=g_strdup(filter);
 228    } else {
 229      p_camelsrt->filter=NULL;
 230    }
 231    camelsrt_reset(p_camelsrt);
 232     
 233    if (filter) {
 234      error_string=register_tap_listener("CAMEL",
 235                                         p_camelsrt,
 236                                         filter,
 237                                         NULL,
 238                                         camelsrt_packet,
 239                                         camelsrt_draw);
 240    } else {  
 241      error_string=register_tap_listener("CAMEL",
 242                                         p_camelsrt,
 243                                         emptyfilter,
 244                                         NULL,
 245                                         camelsrt_packet,
 246                                         camelsrt_draw);
 247    }
 248     
 249    if(error_string){
 250      /* error, we failed to attach to the tap. clean up */
 251      g_free(p_camelsrt->filter);
 252      g_free(p_camelsrt);
 253       
 254      fprintf(stderr, "tshark: Couldn't register camel,srt tap: %s\n",
 255              error_string->str);
 256      g_string_free(error_string, TRUE);
 257      exit(1);
 258    }
 259   
 260    /*
 261     * If we are using tshark, we have to display the stats, even if the stats are not persistent 
 262     * As the frame are proceeded in the chronological order, we do not need persistent stats
 263     * Whereas, with wireshark, it is not possible to have the correct display, if the stats are
 264     * not saved along the analyze 
 265     */  
 266    gtcap_StatSRT=TRUE;
 267    gcamel_StatSRT=TRUE;
 268  }
Show more  




Change Warning 4857.30893 : Useless Assignment

Priority:
State:
Finding:
Owner:
Note: