MCPcopy Create free account
hub / github.com/OpenSIPS/opensips / destroy_hash

Function destroy_hash

modules/dialplan/dp_db.c:690–722  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

688
689
690void 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
725void destroy_rule(dpl_node_t * rule){

Callers 2

destroy_dataFunction · 0.85
dp_load_dbFunction · 0.85

Calls 2

destroy_ruleFunction · 0.85
shm_freeFunction · 0.85

Tested by

no test coverage detected