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

Function free_rtpe_set

modules/rtpengine/rtpengine.c:2080–2108  ·  view source on GitHub ↗

finds the set based upon ID and frees it from list */

Source from the content-addressed store, hash-verified

2078
2079/* finds the set based upon ID and frees it from list */
2080static 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
2105free:
2106 free_rtpe_nodes(crt_list);
2107 shm_free(crt_list);
2108}
2109
2110static void free_rtpe_sets(void)
2111{

Callers 1

mi_reload_rtpenginesFunction · 0.85

Calls 2

free_rtpe_nodesFunction · 0.85
shm_freeFunction · 0.85

Tested by

no test coverage detected