| 688 | |
| 689 | |
| 690 | void destroy_hash(dpl_id_t **rules_hash) |
| 691 | { |
| 692 | dpl_id_p crt_idp; |
| 693 | dpl_index_p indexp; |
| 694 | dpl_node_p rulep; |
| 695 | int i; |
| 696 | |
| 697 | if(!rules_hash || !*rules_hash) |
| 698 | return; |
| 699 | |
| 700 | for(crt_idp = *rules_hash; crt_idp; crt_idp = *rules_hash) { |
| 701 | |
| 702 | for (i = 0, indexp = &crt_idp->rule_hash[i]; |
| 703 | i <= DP_INDEX_HASH_SIZE; |
| 704 | i++, indexp = &crt_idp->rule_hash[i]) { |
| 705 | |
| 706 | for (rulep = indexp->first_rule; rulep; rulep=indexp->first_rule) { |
| 707 | |
| 708 | destroy_rule(rulep); |
| 709 | indexp->first_rule = rulep->next; |
| 710 | |
| 711 | shm_free(rulep); |
| 712 | rulep = NULL; |
| 713 | } |
| 714 | } |
| 715 | *rules_hash = crt_idp->next; |
| 716 | |
| 717 | shm_free(crt_idp); |
| 718 | crt_idp = NULL; |
| 719 | } |
| 720 | |
| 721 | *rules_hash = NULL; |
| 722 | } |
| 723 | |
| 724 | |
| 725 | void destroy_rule(dpl_node_t * rule){ |
no test coverage detected