(/home/sate/Testcases/c/cve/wireshark-1.2.0/plugins/mate/mate_runtime.c) |
| |
| 379 | | | static void analize_gop(mate_gop* gop) { |
| 380 | | | mate_cfg_gog* cfg = NULL; |
| 381 | | | LoAL* gog_keys = NULL; |
| 382 | | | AVPL* curr_gogkey = NULL; |
| 383 | | | void* cookie = NULL; |
| 384 | | | AVPL* gogkey_match = NULL; |
| 385 | | | mate_gog* gog = NULL; |
| 386 | | | gchar* key = NULL; |
| 387 | | | |
| 388 | | | if ( ! ( gog = gop->gog ) ) { |
| 389 | | | |
| 390 | | | dbg_print (dbg_gog,1,dbg_facility,"analize_gop: no gog"); |
| 391 | | | |
| 392 | | | gog_keys = g_hash_table_lookup(mc->gogs_by_gopname,gop->cfg->name); |
| 393 | | | |
| 394 | | | if ( ! gog_keys ) { |
| 395 | | | dbg_print (dbg_gog,1,dbg_facility,"analize_gop: no gog_keys for this gop"); |
| 396 | | | return; |
| 397 | | | } |
| 398 | | | |
| 399 | | | |
| 400 | | | |
| 401 | | | dbg_print (dbg_gog,1,dbg_facility,"analize_gop: got gog_keys: %s",gog_keys->name) ; |
| 402 | | | |
| 403 | | | while (( curr_gogkey = get_next_avpl(gog_keys,&cookie) )) { |
| 404 | | | if (( gogkey_match = new_avpl_exact_match(gop->cfg->name,gop->avpl,curr_gogkey,TRUE) )) { |
| 405 | | | |
| 406 | | | key = avpl_to_str(gogkey_match); |
| 407 | | | |
| 408 | | | dbg_print (dbg_gog,1,dbg_facility,"analize_gop: got gogkey_match: %s",key); |
| 409 | | | |
| 410 | | | if (( gog = g_hash_table_lookup(gop->cfg->gog_index,key) )) { |
| 411 | | | dbg_print (dbg_gog,1,dbg_facility,"analize_gop: got already a matching gog"); |
| 412 | | | |
| 413 | | | if (gog->num_of_counting_gops == gog->num_of_released_gops && gog->expiration < rd->now) { |
| 414 | | | dbg_print (dbg_gog,1,dbg_facility,"analize_gop: this is a new gog, not the old one, let's create it"); |
| 415 | | | |
| 416 | | | gog_remove_keys(gog); |
| 417 | | | |
| 418 | | | gog = new_gog(gog->cfg,gop); |
| 419 | | | |
| 420 | | | break; |
| 421 | | | } else { |
| 422 | | | dbg_print (dbg_gog,1,dbg_facility,"analize_gop: this is our gog"); |
| 423 | | | |
| 424 | | | if (! gop->gog ) adopt_gop(gog,gop); |
| 425 | | | |
| 426 | | | break; |
| 427 | | | } |
| 428 | | | } else { |
| 429 | | | dbg_print (dbg_gog,1,dbg_facility,"analize_gop: no such gog in hash, let's create a new %s",curr_gogkey->name); |
| 430 | | | |
| 431 | | | cfg = g_hash_table_lookup(mc->gogcfgs,curr_gogkey->name); |
| 432 | | | |
| 433 | | | if (cfg) { |
| 434 | | | gog = new_gog(cfg,gop); |
| 435 | | | gog->num_of_gops = 1; |
| 436 | | | |
| 437 | | | if (gop->cfg->start) { |
| 438 | | | gog->num_of_counting_gops = 1; |
| 439 | | | } |
| 440 | | | |
| 441 | | | } else { |
| 442 | | | dbg_print (dbg_gog,0,dbg_facility,"analize_gop: no such gog_cfg: %s",curr_gogkey->name); |
| 443 | | | } |
| 444 | | | |
| 445 | | | break; |
| 446 | | | } |
| 447 | | | |
| 448 | | | |
| 449 | | | delete_avpl(gogkey_match,TRUE); |
Unreachable Call
The highlighted code will not execute under any circumstances. This may be because of: |
|
| 450 | | | gogkey_match = NULL; |
| 451 | | | } |
| 452 | | | |
| 453 | | | if (key) g_free(key); |
| 454 | | | key = NULL; |
| 455 | | | |
| 456 | | | dbg_print (dbg_gog,1,dbg_facility,"analize_gop: no gogkey_match: %s",key); |
| 457 | | | } |
| 458 | | | |
| 459 | | | if (key) g_free(key); |
| 460 | | | |
| 461 | | | if (gogkey_match) delete_avpl(gogkey_match,TRUE); |
| 462 | | | |
| 463 | | | reanalyze_gop(gop); |
| 464 | | | } |
| 465 | | | } |
| |