finds the set based upon ID and frees it from list */
| 2078 | |
| 2079 | /* finds the set based upon ID and frees it from list */ |
| 2080 | static void free_rtpe_set(int id_set) |
| 2081 | { |
| 2082 | struct rtpe_set *prev_list=NULL, *crt_list; |
| 2083 | |
| 2084 | for(crt_list=(*rtpe_set_list)->rset_first; crt_list!=NULL && crt_list->id_set!=id_set; |
| 2085 | crt_list=crt_list->rset_next) |
| 2086 | prev_list = crt_list; |
| 2087 | |
| 2088 | if (!crt_list) { |
| 2089 | LM_DBG("no matching set %d\n", id_set); |
| 2090 | return; |
| 2091 | } |
| 2092 | |
| 2093 | /* first set matched */ |
| 2094 | if (!prev_list) { |
| 2095 | (*rtpe_set_list)->rset_first = crt_list->rset_next; |
| 2096 | goto free; |
| 2097 | } |
| 2098 | |
| 2099 | /* last set matched */ |
| 2100 | if (crt_list->rset_next == NULL) |
| 2101 | (*rtpe_set_list)->rset_last = prev_list; |
| 2102 | |
| 2103 | prev_list->rset_next = crt_list->rset_next; |
| 2104 | |
| 2105 | free: |
| 2106 | free_rtpe_nodes(crt_list); |
| 2107 | shm_free(crt_list); |
| 2108 | } |
| 2109 | |
| 2110 | static void free_rtpe_sets(void) |
| 2111 | { |
no test coverage detected